package.json node-sass脚本不起作用,npm错误!代码ELIFECYCLE npm ERR! errno 1

时间:2020-05-15 08:54:25

标签: node.js npm sass

我试图创建可编译sass的脚本,但是我一直收到这个奇怪的错误。我已经尝试将node-sass ./sass/main.scss ./css/style.css放到cmd上,并且在那里工作良好,但是当我尝试运行npm run compile:sass时,我一直收到此错误。有没有人处理过这种错误?而且我已经安装了node-sass作为dev depencie。


> natours@1.0.0 compile:sass G:\Projektit\Udemy\CSS & SASS\Natours
> node-sass ./sass/main.scss ./css/style.css

'SASS\Natours\node_modules\.bin\' is not recognized as an internal or external command,
operable program or batch file.
internal/modules/cjs/loader.js:638
    throw err;
    ^

Error: Cannot find module 'G:\Projektit\Udemy\node-sass\bin\node-sass'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
    at Function.Module._load (internal/modules/cjs/loader.js:562:25)
    at Function.Module.runMain (internal/modules/cjs/loader.js:829:12)
    at startup (internal/bootstrap/node.js:283:19)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! natours@1.0.0 compile:sass: `node-sass ./sass/main.scss ./css/style.css`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the natours@1.0.0 compile:sass script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.```

0 个答案:

没有答案