G
G
Gary_Popper2018-10-06 15:29:23
npm
Gary_Popper, 2018-10-06 15:29:23

Project assembly. What is wrong with npm script?

I repeat after the lesson on the net.
He succeeded, I made some mistake.
I googled, but I didn’t find much in Russian, but I couldn’t figure it out in English, because I’m not so familiar with npm.
installed postcss
-cli autoprefixer
I don't see any syntax errors.
tried changing the task to :""prefix:css": "postcss --use autoprefixer --autoprefixer.browsers 'last 2 versions' css/style.concat.css -o css/style.prefix.css""
opened debug file:
0 info it worked if it ends with ok
1 verbose cli [ 'D:\\node.exe',
1 verbose cli 'D:\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli 'run',
1 verbose cli 'prefix:css'
3 info using [email protected]
4 verbose run-script [ 'prefix:css' ]
5 info lifecycle [email protected]~prefix:css: [email protected]
6 verbose lifecycle [email protected]~prefix:css : unsafe-perm in lifecycle true
7 verbose lifecycle [email protected]~prefix:css: PATH: D:\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;C:\Users\trans\Desktop\sublime\advanced_css\node_modules\. bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Skype\Phone\ ;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0 \;C:\WINDOWS\System32\OpenSSH\;D:\;C:\Users\trans\AppData\Local\Microsoft\WindowsApps;C:\Program Files\Microsoft VS Code\bin;C:\Users\trans\ AppData\Roaming\npm
8 verbose lifecycle [email protected]~prefix:css: CWD: C:\Users\trans\Desktop\sublime\advanced_css
9 silly lifecycle [email protected]~prefix:css: Args: [ '/ d/s/c',
9 silly lifecycle 'postcss --use autoprefixer -b \'last 10 versions\' css/style.concat.css -o css/style.prefix.css' ]
10 silly lifecycle [email protected]~prefix:css: Returned : code: 1 signal: null
11 info lifecycle [email protected]~prefix:css: Failed to exec prefix:css script
12 verbose stack Error: [email protected] prefix:css: `postcss --use autoprefixer -b ' last 10 versions' css/style.concat.css -o css/style.prefix.css`
12 verbose stack Exit status 1
12 verbose stack at EventEmitter. (D:\node_modules\npm\node_modules\npm-lifecycle\index.js:285:16)
12 verbose stack at emitTwo (events.js:126:13)
12 verbose stack at EventEmitter.emit (events.js:214: 7)
12 verbose stack at ChildProcess. (D:\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
12 verbose stack at emitTwo (events.js:126:13)
12 verbose stack at ChildProcess.emit (events.js: 214:7)
12 verbose stack at maybeClose (internal/child_process.js:925:16)
12 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
13 verbose pkgid [email protected]
14 verbose cwd C:\Users\trans\Desktop\sublime\advanced_css
15 verbose Windows_NT 10.0.17134
16 verbose argv "D:\\node.exe" "D:\\node_modules\\npm\\bin\\npm-cli .js" "run" "prefix:css"
17 verbose node v8.11.4
18 verbose npm v5.6.
21 error [email protected] prefix:css: `postcss --use autoprefixer -b 'last 10 versions' css/style.concat.css -o css/style.prefix.css`
21 error Exit status 1
22 error Failed at the [email protected] prefix:css script.
22 error This is probably not a problem with npm. There is likely additional logging output above.
23 verbose exit [ 1, true ]
doesn't mean anything to me
And where should I look when similar problems arise in the future?
in the debay file, in theory, there should be a clue, right?
which of the lines can tell what is the cause of the error?
does anyone know what could be the problem? mistake? how to fix?
5bb8a963dd88d827340422.png

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
AnnaMut, 2018-10-11
@AnnaMut

Try the following steps:
- First run: npm cache clean --force on the command line in the project directory
- Then remove the node_modules folder from the project
- Remove the package-lock.json file from the project
- After these steps run: npm install
Had the same error, these steps helped.

A
arty4, 2019-02-12
@arty4

Try this: "prefix": "postcss css/style.concat.css -u autoprefixer -o css/style.prefix.css"

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question