ionic-framework - 创建 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.
感谢
解决方案
尝试在 C:\Users\\AppData\Roaming\npm-cache\ 清除 npm 缓存
推荐阅读
- html - 为什么100vh的元素比屏幕大?
- python - 使用 python 将文件名从 file1..file1000 重命名为 file1001...file2000
- for-loop - 使用 for 循环删除最后一个字符
- swiftui - 如何在swiftUI中去另一个视图onclick LazyVGrid GridItem?
- python - 做简单的python递归时出现问题
- mqtt - 当我在 verneMQ 集群中重新启动代理时,排队的消息会丢失
- javascript - 我想点击一个单选按钮
- python - tkinter 函数如何处理它作为参数的列表,一个接一个,一个接一个?
- python - 我如何让机器人不仅考虑自己
- python - 为什么 selenium 只迭代 5 次而不是完成数据集