使用npm -g install js-beautify
npm ERR! path /home/developer/software/nodejs/lib/node_modules/js-
beautify/js/bin/css-beautify.js
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall chmod
npm ERR! enoent ENOENT: no such file or directory, chmod
'/home/developer/software/nodejs/lib/node_modules/js-
beautify/js/bin/css-beautify.js'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! A complete log of this run can be found in:
npm ERR! /home/developer/.npm/_logs/2017-09-18T07_52_38_910Z-
debug.log
可以做些什么来解决这个问题?
我使用节点8.5.0和npm 5.3.0
答案 0 :(得分:17)
答案 1 :(得分:0)
我的修正是添加到package.json
:
"devDependencies": {
"js-beautify": "1.6.14",
和
"resolutions": {
"js-beautify": "1.6.14"
}
然后删除node_modules/
目录
并最终使用npm install
重新安装所有依赖项(出于某种原因,纱线会失败 - 即使在删除yarn.lock之后)
答案 2 :(得分:-1)
将此添加到package.json以进行临时修复
"dependencies": {
"js-beautify": "1.6.14"
}