我多次尝试运行 npm 脚本我还在 package.json
文件中添加了脚本但是它显示了一些错误实际上我正在构建一个网站并且我需要 npm sass 来制作它但是npm run compile:sass
这是我的脚本显示错误这是面临问题的图像。
脚本代码如下:
{
"name":"natours",
"version":"1.0.0",
"description":"landing page for natours",
"main":"index.js",
"scripts":{
"compile:sass":"node-sass sass/main.scss css/style.css" <=====
},
"author":"Kishan",
"license":"ISC",
"devDependencies":{
"node-sass":"^4.9.0"
}
}
这是命令提示符中的错误:
C:\Users\ANONYMOUS>npm run compile:sass
npm ERR! path C:\Users\ANONYMOUS\package.json
npm ERR! code ENOENT
npm ERR! errno -4058
npm ERR! syscall open
npm ERR! enoent ENOENT: no such file or directory, open 'C:\Users\ANONYMOUS\package.json'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\ANONYMOUS\AppData\Roaming\npm-cache_logs\2018-06-17T05_39_21_109Z-debug.log C:\Users\ANONYMOUS>
最佳答案
您在 node-sass sass/main.scss 和 css/style.css 之间缺少逗号
应该是node-sass sass/main.scss, css/style.css
关于html - 我无法运行 npm run script 它显示了许多错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50893856/