我在Ionic 3中尝试创建新项目的日子不好过。我有以下版本:
我正在使用Ubuntu 18,每次都使用:
sudo ionic start test blank
我收到此消息:
https://nodejs.org/download/release/v8.10.0/node-v8.10.0-headers.tar.gz
gyp WARN install got an error, rolling back install
gyp verb command remove [ '8.10.0' ]
gyp verb remove using node-gyp dir: /home/abraham/.node-gyp
gyp verb remove removing target version: 8.10.0
gyp verb remove removing development files for version: 8.10.0
gyp ERR! configure error
gyp ERR! stack Error: ENOENT: no such file or directory, open
'/home/abraham/='
gyp ERR! stack at Object.fs.openSync (fs.js:646:18)
gyp ERR! stack at Object.fs.readFileSync (fs.js:551:33)
gyp ERR! stack at readCAFile
(/home/abraham/Documentos/Ionic/IonicCurso/prueba/prueba/node_modules/node-gyp/lib/install.js:472:15)
gyp ERR! stack at download
(/home/abraham/Documentos/Ionic/IonicCurso/prueba/prueba/node_modules/node-gyp/lib/install.js:444:22)
gyp ERR! stack at
/home/abraham/Documentos/Ionic/IonicCurso/prueba/prueba/node_modules/node-gyp/lib/install.js:189:19
gyp ERR! stack at
/home/abraham/Documentos/Ionic/IonicCurso/prueba/prueba/node_modules/mkdirp/index.js:48:26
gyp ERR! stack at FSReqWrap.oncomplete (fs.js:153:5)
gyp ERR! System Linux 4.15.0-43-generic
gyp ERR! command "/usr/bin/node"
"/home/abraham/Documentos/Ionic/IonicCurso/prueba/prueba/node_modules/node-gyp/bin/node-gyp.js"
"rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags="
"--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd
/home/abraham/Documentos/Ionic/IonicCurso/prueba/prueba/node_modules/node-sass
gyp ERR! node -v v8.10.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
Build failed with error code: 1
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.7
(node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for
fsevents@1.2.7: wanted {"os":"darwin","arch":"any"} (current:
{"os":"linux","arch":"x64"})
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-sass@4.5.3 postinstall: `node scripts/build.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-sass@4.5.3 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! /home/abraham/.npm/_logs/2019-01-26T16_26_10_675Z-debug.log
由于已经尝试过,我不知道是否需要重新安装离子泵:
npm rebuild node-sass
感谢您的帮助
答案 0 :(得分:0)
有时候,您不想更改npm使用的默认目录的所有权(即/ usr),因为这可能会引起一些问题,例如,如果您要与其他用户共享系统。
相反,您可以将npm配置为完全使用其他目录。对于我们来说,这将是我们主文件夹中的隐藏目录。
为全局安装创建目录:
mkdir ~/.npm-global
配置npm以使用新的目录路径:
npm config set prefix '~/.npm-global'
打开或创建〜/ .profile文件并添加以下行:
export PATH=~/.npm-global/bin:$PATH
返回命令行,更新系统变量:
source ~/.profile