Hello,
Im trying to make vsce package for my settings sync extension
Commit : 3cb00b67b9fc3b58f6812c98a1ea70998452b8a3
in v2.9 branch.
Latest npm and node verified.
Removed packages and installed again and same error on package and even on travis CI
Getting this error:
PS C:\Dropbox\Github_Repo\code_extension\code-settings-sync> vsce package
Executing prepublish script 'npm run vscode:prepublish'...
Error: Command failed: npm run vscode:prepublish
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! [email protected] vscode:prepublish: `tsc -p ./`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the [email protected] vscode:prepublish 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! C:\Users\shana\AppData\Roaming\npm-cache\_logs\2018-03-03T00_03_14_909Z-debug.log
with log file
0 info it worked if it ends with ok
1 verbose cli [ 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli 'C:\\Users\\shana\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli 'run',
1 verbose cli 'vscode:prepublish' ]
2 info using [email protected]
3 info using [email protected]
4 verbose run-script [ 'prevscode:prepublish',
4 verbose run-script 'vscode:prepublish',
4 verbose run-script 'postvscode:prepublish' ]
5 info lifecycle [email protected]~prevscode:prepublish: [email protected]
6 info lifecycle [email protected]~vscode:prepublish: [email protected]
7 verbose lifecycle [email protected]~vscode:prepublish: unsafe-perm in lifecycle true
8 verbose lifecycle [email protected]~vscode:prepublish: PATH: C:\Users\shana\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;C:\Dropbox\Github_Repo\code_extension\code-settings-sync\node_modules\.bin;C:\ProgramData\Oracle\Java\javapath;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files\Microsoft SQL Server\120\DTS\Binn\;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\110\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\120\Tools\Binn\;C:\Program Files\Microsoft SQL Server\120\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\120\Tools\Binn\ManagementStudio\;C:\Program Files (x86)\Microsoft SQL Server\120\DTS\Binn\;C:\Program Files\Git\cmd;C:\Program Files\Microsoft SQL Server\130\Tools\Binn\;C:\Program Files\dotnet\;C:\Program Files (x86)\Skype\Phone\;C:\Program Files\nodejs\;C:\Users\shana\AppData\Local\Microsoft\WindowsApps;C:\Users\shana\AppData\Local\Programs\MiKTeX 2.9\miktex\bin\x64\;C:\Program Files\Microsoft VS Code\bin;C:\Users\shana\AppData\Roaming\npm
9 verbose lifecycle [email protected]~vscode:prepublish: CWD: C:\Dropbox\Github_Repo\code_extension\code-settings-sync
10 silly lifecycle [email protected]~vscode:prepublish: Args: [ '/d /s /c', 'tsc -p ./' ]
11 silly lifecycle [email protected]~vscode:prepublish: Returned: code: 2 signal: null
12 info lifecycle [email protected]~vscode:prepublish: Failed to exec vscode:prepublish script
13 verbose stack Error: [email protected] vscode:prepublish: `tsc -p ./`
13 verbose stack Exit status 2
13 verbose stack at EventEmitter.<anonymous> (C:\Users\shana\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\index.js:285:16)
13 verbose stack at EventEmitter.emit (events.js:127:13)
13 verbose stack at ChildProcess.<anonymous> (C:\Users\shana\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
13 verbose stack at ChildProcess.emit (events.js:127:13)
13 verbose stack at maybeClose (internal/child_process.js:936:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:220:5)
14 verbose pkgid [email protected]
15 verbose cwd C:\Dropbox\Github_Repo\code_extension\code-settings-sync
16 verbose Windows_NT 10.0.16299
17 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\shana\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "run" "vscode:prepublish"
18 verbose node v9.7.1
19 verbose npm v5.6.0
20 error code ELIFECYCLE
21 error errno 2
22 error [email protected] vscode:prepublish: `tsc -p ./`
22 error Exit status 2
23 error Failed at the [email protected] vscode:prepublish script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 2, true ]
Hi! What was your solution to this error. Please share
Hi @shanalikhan , I am facing the same issue and would be thankfull to have any hint , did you found a way out of this issue ?
I had updated some npm packages.
When i reverted them it worked.
Ok thanks a lot, I found my way out too !
Instead of reverting, I choosed to move forward with the following commands :
npm install -g node@latest
npm install -g npm@latest
npm install -g vscode@latest
npm install -g vsce@latest
I think this helped to correct some hidden issues (moving forward is always good isn't it ?), but I still had the same error log.
Then I copy/paste the corresponding 17th line in your log file, removing extra backslashes, and pasting it to a DOS CMD
"C:\Program Files\nodejs\node.exe" "C:\Users ... ...
Then it shows me some extra-logging information, the tsc -p ./ step raised some error in my plugin (an orphaned declared variabled that was not read anywhere, and an assignement that was facing a type-matching issue).
These errors didn't showed up when I was developping my plugin, but it seems that the tsc copiler is more strict.
So I fixed the remaining inconsistencies in my code, and run a succeeding vsce package.
Ourah !
Post Scriptum : I forgot to say that I also junked out the node_modules directory, and executed a npm install sometime, within my plugin directory.
Try npm run compile to get more error message.
Most helpful comment
Ok thanks a lot, I found my way out too !
Instead of reverting, I choosed to move forward with the following commands :
npm install -g node@latestnpm install -g npm@latestnpm install -g vscode@latestnpm install -g vsce@latestI think this helped to correct some hidden issues (moving forward is always good isn't it ?), but I still had the same error log.
Then I copy/paste the corresponding 17th line in your log file, removing extra backslashes, and pasting it to a DOS CMD
"C:\Program Files\nodejs\node.exe" "C:\Users ... ...Then it shows me some extra-logging information, the
tsc -p ./step raised some error in my plugin (an orphaned declared variabled that was not read anywhere, and an assignement that was facing a type-matching issue).These errors didn't showed up when I was developping my plugin, but it seems that the tsc copiler is more strict.
So I fixed the remaining inconsistencies in my code, and run a succeeding
vsce package.Ourah !