npm安装失败 - 错误消息:enoent ENOENT:没有这样的文件或目录

时间:2017-09-18 10:26:52

标签: npm npm-install

我正在使用vue init webpack project_name构建Vue.js项目,在此步骤之后我运行了npm install。和npm抛出以下错误:

npm ERR! path /Users/duodian/Desktop/crop-demo/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 
'/Users/duodian/Desktop/crop-demo/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!     /Users/duodian/.npm/_logs/2017-09-18T09_55_20_047Z-debug.log

节点版本8.5.0
npm版本5.3.0
注意:我刚刚将macOS HighSierra更新为10.13 Beta,这会影响吗?

有朋友有这个问题吗?

2 个答案:

答案 0 :(得分:1)

这是因为js-beautify@1.7我被打破了。因此,尝试将vue-cli降级到2.7.0是解决此问题的临时解决方法

npm install -g vue-cli@2.7.0

答案 1 :(得分:1)

运行

npm install js-beautify@1.6.14

然后

npm install (assuming that you are installing deps in package.json)

为我工作。从这里得到它。 https://github.com/beautify-web/js-beautify/issues/1247