首页 > 解决方案 > 创建 ionic 项目时,运行 subprocess npm 时出现错误

问题描述

当我尝试在 ionic 2 上开发一个新项目时,我刚刚收到此错误。

我得到一个 mkdir 错误,即使在 sudo 上运行命令,我也使用 mac os。

我尝试重新安装节点,cordovan npm,尝试进行一些更新,并用谷歌搜索了问题,但找不到解决方案。

请帮助我,我是离子初学者。

错误:

gyp ERR! configure error 
gyp ERR! stack Error: EACCES: permission denied, mkdir '/Users/Loic/appIonic/swipeCard/test/node_modules/node-sass/build'
gyp ERR! System Darwin 17.7.0
gyp ERR! command "/usr/local/bin/node" "/Users/Loic/appIonic/swipeCard/test/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd /Users/Loic/appIonic/swipeCard/test/node_modules/node-sass
gyp ERR! node -v v10.10.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok 
Build failed with error code: 1
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-sass@4.9.0 postinstall: `node scripts/build.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the node-sass@4.9.0 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/Loic/.npm/_logs/2018-09-22T16_45_54_600Z-debug.log
[ERROR] An error occurred while running subprocess npm.

        npm i exited with exit code 1.

        Re-running this command with the --verbose flag may provide more information.

感谢

标签: ionic-frameworkionic2

解决方案


尝试在 C:\Users\\AppData\Roaming\npm-cache\ 清除 npm 缓存


推荐阅读