error This module isn‘t specified in a package.json file.

简介: error This module isn‘t specified in a package.json file.

报错如下:

解决办法:

首先先删除node_modules安装包,执行以下命令

(没有 rimraf包的先安装 rimraf包 执行以下命令 npm install rimraf -g有的请忽略)
rimraf node_modules

其次,打开package.json文件

然后再执行yarn add sass -D成功解决👏👏👏👏👏👏👏


相关文章
|
16天前
|
JSON JavaScript 前端开发
【报错】unexpected non-whitespace character after JSON
【报错】unexpected non-whitespace character after JSON
|
1月前
|
JSON 数据格式
“JSON parse error: Unexpected character (‘1‘ (code 49))的解决方式
“JSON parse error: Unexpected character (‘1‘ (code 49))的解决方式
20 0
|
3月前
|
JSON 缓存 前端开发
Unexpected end of JSON input while parsing near '....1","eslint-loader":"'
Unexpected end of JSON input while parsing near '....1","eslint-loader":"'
|
6月前
|
JavaScript Cloud Native Go
Error: Cannot find module ‘webpack/bin/config-yargs‘ at Function.Module._resolveFilename (intern
Error: Cannot find module ‘webpack/bin/config-yargs‘ at Function.Module._resolveFilename (intern
32 0
|
JavaScript
Module not found: Error: Can‘t resolve ‘path‘
Module not found: Error: Can‘t resolve ‘path‘
775 0
|
前端开发
前端项目实战210-Couldn‘t find a package.json file
前端项目实战210-Couldn‘t find a package.json file
59 0
前端项目实战210-Couldn‘t find a package.json file
|
JSON 前端开发 JavaScript
SyntaxError: Unexpected number in JSON at position 7 at JSON.parse (<anonymous>)前端接收到数据,无法进入success
SyntaxError: Unexpected number in JSON at position 7 at JSON.parse (<anonymous>)前端接收到数据,无法进入success
160 0
SyntaxError: Unexpected number in JSON at position 7 at JSON.parse (<anonymous>)前端接收到数据,无法进入success
|
JSON 数据格式
JSON.parse()报错 Unexpected token o in JSON at position 1
JSON.parse()报错 Unexpected token o in JSON at position 1
164 0
|
JSON 数据格式
解决:Could not write JSON: No serializer found for class *** and no properties错误
解决:Could not write JSON: No serializer found for class *** and no properties错误
555 0