node-sass的离子启动失败

时间:2017-11-21 12:33:36

标签: ionic-framework ionic3 node-gyp node-sass

当我跑步时

sudo ionic start newapp blank

我收到了node-sass的错误:

Unable to save binary /home/user/code/newapp/node_modules/node-sass/vendor/linux-x64-48 : { Error: 
        EACCES: permission denied, mkdir '/home/user/code/newapp/node_modules/node-sass/vendor'
             at Error (native)
             at Object.fs.mkdirSync (fs.js:924:18)
             at sync (/home/user/code/newapp/node_modules/mkdirp/index.js:71:13)
             at Function.sync (/home/user/code/newapp/node_modules/mkdirp/index.js:77:24)
             at checkAndDownloadBinary (/home/user/code/newapp/node_modules/node-sass/scripts/install.js:111:11)
             at Object.<anonymous> (/home/user/code/newapp/node_modules/node-sass/scripts/install.js:154:1)
             at Module._compile (module.js:570:32)
             at Object.Module._extensions..js (module.js:579:10)
             at Module.load (module.js:487:32)
             at tryModuleLoad (module.js:446:12)
           errno: -13,
           code: 'EACCES',
           syscall: 'mkdir',
           path: '/home/user/code/newapp/node_modules/node-sass/vendor' }

然后

gyp verb build dir attempting to create "build" dir: /home/user/code/newapp/node_modules/node-sass/build
gyp ERR! configure error 
gyp ERR! stack Error: EACCES: permission denied, mkdir 
        '/home/user/code/newapp/node_modules/node-sass/build'
gyp ERR! stack     at Error (native)
gyp ERR! System Linux 4.4.0-98-generic
gyp ERR! command "/usr/bin/node" "/home/user/code/newapp/node_modules/node-gyp/bin/node-gyp.js" 
        "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd /home/user/code/newapp/node_modules/node-sass
gyp ERR! node -v v6.11.5
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok 
Build failed with error code: 1

我一直在搞乱权限,手动创建目录和全局安装node-sass。但我不能让离子开始成功。

ionic:v3.18.0,node:v6.11.5,npm:v5.5.1,node-sass:v4.5.3

0 个答案:

没有答案