运行子流程npm在创建离子项目时遇到错误

问题描述 投票:1回答:2

当我尝试在离子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! [email protected] postinstall: `node scripts/build.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] 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-framework ionic2
2个回答
0
投票

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


0
投票

我没有使用离子六个月。当我回来时,他们让我将离子更新到最新版本。更新后,我甚至无法启动新项目。因此,在浪费了一段时间后,我只是使用命令将其降级为离子3.20.0

npm install -g cordova [email protected]

现在它工作正常

© www.soinside.com 2019 - 2024. All rights reserved.