Received Z_BUF_ERROR while installing NativeScript - nativescript

I just received Z_BUF_ERROR while installing NativeScript. I did Google but without any luck.
Environment:
Windows 10 Enterprise 1703 64-bit
NodeJS v6.11.2
npm v5.3.0
Command:
npm install -g nativescript
Error Log:
0 info it worked if it ends with ok
1 verbose cli [ 'C:\Program Files\nodejs\node.exe',
1 verbose cli 'C:\Users\Hui\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js',
1 verbose cli 'install',
1 verbose cli '-g',
1 verbose cli 'nativescript' ]
2 info using npm#5.3.0
3 info using node#v6.11.2
4 verbose npm-session 4454628f9775be96
5 silly install loadCurrentTree
6 silly install readGlobalPackageData
7 http fetch GET 200 https://registry.npmjs.org/nativescript 1244ms
8 http fetch GET 200 https://registry.npmjs.org/nativescript/-/nativescript-3.1.3.tgz 23ms (from cache)
9 silly fetchPackageMetaData error for nativescript#latest unexpected end of file
10 verbose stack Error: unexpected end of file
10 verbose stack at Zlib._handle.onerror (zlib.js:370:17)
11 verbose cwd D:\Dev\Workspace\Local\Angular
12 verbose Windows_NT 10.0.15063
13 verbose argv "C:\Program Files\nodejs\node.exe" - "C:\Users\Hui\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js" "install" "-g" "nativescript"
14 verbose node v6.11.2
15 verbose npm v5.3.0
16 error code Z_BUF_ERROR
17 error errno -5
18 error unexpected end of file
19 verbose exit [ -5, true ]
Any help would be appreciated.

try to clean cache by using this
npm cache clean --force

Related

npm run watch says some problems

In the browser: Unable to locate Mix file: /vendor/perfect-scrollbar.css. (View: E:\xampp\htdocs\stacklaravel\resources\views\vendor\stack\partials\header.blade.php)
npm run watch says some problems!
I faced an error npm run watch
0 info it worked if it ends with ok
1 verbose cli [
1 verbose cli 'C:\Program Files\nodejs\node.exe',
1 verbose cli 'C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js',
1 verbose cli 'run',
1 verbose cli 'watch'
1 verbose cli ]
2 info using npm#6.14.10
3 info using node#v14.15.4
4 verbose run-script [ 'prewatch', 'watch', 'postwatch' ]
5 info lifecycle #~prewatch: #
6 info lifecycle #~watch: #
7 verbose lifecycle #~watch: unsafe-perm in lifecycle true
8 verbose lifecycle #~watch: PATH: C:\Program Files\nodejs\node_modules\npm\node_modules\npm-
lifecycle\node-gyp-bin;E:\xampp\htdocs\stacklaravel\node_modules.bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Program Files\Git\cmd;C:\Program Files\dotnet;C:\Program Files\Microsoft SQL Server\130\Tools\Binn;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn;C:\Program Files (x86)\Microsoft SQL Server\150\Tools\Binn;C:\Program Files\Microsoft SQL Server\150\Tools\Binn;C:\Program Files\Microsoft SQL Server\150\DTS\Binn;C:\Program Files (x86)\Microsoft SQL Server\150\DTS\Binn;C:\Program Files\Azure Data Studio\bin;C:\Windows\System32\OpenSSH;C:\OpenSSH-Win64;C:\ProgramData\ComposerSetup\bin;C:\Program Files (x86)\dotnet;C:\Program Files\nodejs;C:\laragon\bin;C:\laragon\bin\apache\httpd-2.4.35-win64-VC15\bin;C:\laragon\bin\composer;C:\laragon\bin\laragon\utils;C:\laragon\bin\mysql\mysql-5.7.24-winx64\bin;C:\laragon\bin\nginx\nginx-1.16.0;C:\laragon\bin\ngrok;C:\laragon\bin\notepad++;C:\laragon\bin\edited\php\php-7.2.19-Win32-VC15-x64;C:\laragon\bin\putty;C:\laragon\bin\redis\redis-x64-3.2.100;C:\laragon\bin\telnet;C:\laragon\usr\bin;C:\Users\Prosigns\AppData\Local\Yarn\config\global\node_modules.bin;C:\Users\Prosigns\AppData\Roaming\Composer\vendor\bin;C:\Users\Prosigns\AppData\Local\Microsoft\WindowsApps;C:\Users\Prosigns\AppData\Local\Programs\Microsoft VS Code\bin;C:\Program Files\Azure Data Studio\bin;F:\xampp\edited\php;E:\xampp\php; C:\Users\Prosigns\AppData\Roaming\Composer\vendor\bin;C:\Users\Prosigns\AppData\Roaming\npm
9 verbose lifecycle #~watch: CWD: E:\xampp\htdocs\stacklaravel
10 silly lifecycle #~watch: Args: [ '/d /s /c', 'mix watch' ]
11 silly lifecycle #~watch: Returned: code: 2 signal: null
12 info lifecycle #~watch: Failed to exec watch script
13 verbose stack Error: # watch: mix watch
13 verbose stack Exit status 2
13 verbose stack at EventEmitter. (C:\Program
Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\index.js:332:16)
13 verbose stack at EventEmitter.emit (events.js:315:20)
13 verbose stack at ChildProcess. (C:\Program
Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
13 verbose stack at ChildProcess.emit (events.js:315:20)
13 verbose stack at maybeClose (internal/child_process.js:1048:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:288:5)
14 verbose pkgid #
15 verbose cwd E:\xampp\htdocs\stacklaravel
16 verbose Windows_NT 10.0.16299
17 verbose argv "C:\Program Files\nodejs\node.exe" "C:\Program
Files\nodejs\node_modules\npm\bin\npm-cli.js" "run" "watch"
18 verbose node v14.15.4
19 verbose npm v6.14.10
20 error code ELIFECYCLE
21 error errno 2
22 error # watch: mix watch
22 error Exit status 2
23 error Failed at the # watch script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 2, true ]
What is the cause if these errors? How can i fix it?
This issue is caused by not having nodejs installed or by having an out of date version of nodejs.
When I had this issue I found out I was running node v.10.19.0, I upgraded to 15.6.0 and now it works.
I’m running Ubuntu 20.04, if you are too try the following commands:
sudo apt update
curl -sL https://deb.nodesource.com/setup_15.x | sudo bash -
sudo apt-get install -y nodejs
node -v

how to run Node-Red in docker using windows

I use this command in windows
I actually don't know where node_red_data is.
docker run -it -p 1882:1880 -v node_red_data:/data nodered/node-red
and I got following error.
npm ERR! code EJSONPARSE
npm ERR! file /usr/src/node-red/package.json
npm ERR! JSON.parse Failed to parse json
npm ERR! JSON.parse Unexpected end of JSON input while parsing near ''
npm ERR! JSON.parse Failed to parse package.json data.
npm ERR! JSON.parse package.json must be actual JSON, not just JavaScript.
npm ERR! A complete log of this run can be found in:
npm ERR! /data/.npm/_logs/2021-01-26T11_44_30_912Z-debug.log
this is also my log file
this file is created automatically inside my node_red_data folder
0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/bin/node',
1 verbose cli '/usr/local/bin/npm',
1 verbose cli '--no-update-notifier',
1 verbose cli '--no-fund',
1 verbose cli 'start',
1 verbose cli '--cache',
1 verbose cli '/data/.npm',
1 verbose cli '--',
1 verbose cli '--userDir',
1 verbose cli '/data' ]
2 info using npm#6.14.10
3 info using node#v10.23.1
4 verbose config Skipping project config: /usr/src/node-red/.npmrc. (matches userconfig)
5 verbose stack Error: Failed to parse json
5 verbose stack Unexpected end of JSON input while parsing near ''
5 verbose stack at parseError (/usr/local/lib/node_modules/npm/node_modules/read-package-json/read-json.js:470:11)
5 verbose stack at parseJson (/usr/local/lib/node_modules/npm/node_modules/read-package-json/read-json.js:105:26)
5 verbose stack at /usr/local/lib/node_modules/npm/node_modules/read-package-json/read-json.js:52:5
5 verbose stack at /usr/local/lib/node_modules/npm/node_modules/graceful-fs/graceful-fs.js:123:16
5 verbose stack at FSReqWrap.readFileAfterClose [as oncomplete] (internal/fs/read_file_context.js:53:3)
6 verbose cwd /usr/src/node-red
7 verbose Linux 4.19.128-microsoft-standard
8 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "--no-update-notifier" "--no-fund" "start" "--cache" "/data/.npm" "--" "--userDir" "/data"
9 verbose node v10.23.1
10 verbose npm v6.14.10
11 error code EJSONPARSE
12 error file /usr/src/node-red/package.json
13 error JSON.parse Failed to parse json
13 error JSON.parse Unexpected end of JSON input while parsing near ''
14 error JSON.parse Failed to parse package.json data.
14 error JSON.parse package.json must be actual JSON, not just JavaScript.
15 verbose exit [ 1, true ]
any help?
Hey the issue you are facing originates in mounting the volume (-v ...) you need to pass a valid Windows Path as an argument. For more information: Official Docker documentation
Command to run Node-RED as a Docker container: docker run -p 1880:1880 -it -v "<Path-on-your-Windows-OS>:/data" nodered/node-red
Where <Path-on-your-Windows-OS> e.g. C:\Users\<username>\Documents\node-red-docker
I just made my own node-red instance. I couldn't work with node-red image.
FROM node
WORKDIR /usr/src/node-red
RUN npm install -g --unsafe-perm node-red
CMD node-red

Webpack 13 verbose stack Error: my-project#1.0.0 build: webpack --mode development

I'm attending a bootcamp running Mac and using windows at home. I downloaded a webpack project from github to run on my windows 7 system and it won't build. I found this error in a search and it advised running
npm install webpack-dev-server#2.9.7 --save-dev
, but the error persists. I tried starting over on my Win10 laptop and i get the same error.
I did find guidance that on package.json, I should change this line:
"start": "npm run build & webpack-dev-server --open --mode development",
The change was previously using a semi-colon instead of "&". Still no joy.
I need some help.
here is the error log:
0 info it worked if it ends with ok
1 verbose cli [
1 verbose cli 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli 'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli 'run',
1 verbose cli 'build'
1 verbose cli ]
2 info using npm#6.12.0
3 info using node#v12.13.0
4 verbose run-script [ 'prebuild', 'build', 'postbuild' ]
5 info lifecycle my-project#1.0.0~prebuild: my-project#1.0.0
6 info lifecycle my-project#1.0.0~build: my-project#1.0.0
7 verbose lifecycle my-project#1.0.0~build: unsafe-perm in lifecycle true
8 verbose lifecycle my-project#1.0.0~build: PATH: C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;C:\Users\MP3 Machine\code\doctor-week6-codereview\node_modules\.bin;C:\Users\MP3 Machine\bin;C:\Program Files\Git\mingw64\bin;C:\Program Files\Git\usr\local\bin;C:\Program Files\Git\usr\bin;C:\Program Files\Git\usr\bin;C:\Program Files\Git\mingw64\bin;C:\Program Files\Git\usr\bin;C:\Users\MP3 Machine\bin;C:\PROGRAM FILES\COMMON FILES\MICROSOFT SHARED\WINDOWS LIVE;C:\PROGRAM FILES (X86)\COMMON FILES\MICROSOFT SHARED\WINDOWS LIVE;C:\Windows\SYSTEM32;C:\Windows;C:\Windows\SYSTEM32\WBEM;C:\Windows\SYSTEM32\WINDOWSPOWERSHELL\V1.0;C:\PROGRAM FILES (X86)\MICROSOFT SQL SERVER\80\TOOLS\BINN;C:\PROGRAM FILES (X86)\OPENVPN\BIN;C:\PROGRAM FILES (X86)\WINDOWS LIVE\SHARED;C:\Program Files\WIDCOMM\Bluetooth Software;C:\Program Files\WIDCOMM\Bluetooth Software\syswow64;C:\Program Files (x86)\QuickTime\QTSystem;C:\Program Files\Git\cmd;C:\Program Files\nodejs;C:\Program Files\MySQL\MySQL Shell 8.0\bin;C:\Users\MP3 Machine\AppData\Local\learn_ide_3\bin;C:\Users\MP3 Machine\AppData\Roaming\npm;C:\Program Files\Git\usr\bin\vendor_perl;C:\Program Files\Git\usr\bin\core_perl
9 verbose lifecycle my-project#1.0.0~build: CWD: C:\Users\MP3 Machine\code\doctor-week6-codereview
10 silly lifecycle my-project#1.0.0~build: Args: [ '/d /s /c', 'webpack --mode development' ]
11 silly lifecycle my-project#1.0.0~build: Returned: code: 2 signal: null
12 info lifecycle my-project#1.0.0~build: Failed to exec build script
13 verbose stack Error: my-project#1.0.0 build: `webpack --mode development`
13 verbose stack Exit status 2
13 verbose stack at EventEmitter.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\index.js:332:16)
13 verbose stack at EventEmitter.emit (events.js:210:5)
13 verbose stack at ChildProcess.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
13 verbose stack at ChildProcess.emit (events.js:210:5)
13 verbose stack at maybeClose (internal/child_process.js:1021:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5)
14 verbose pkgid my-project#1.0.0
15 verbose cwd C:\Users\MP3 Machine\code\doctor-week6-codereview
16 verbose Windows_NT 6.1.7601
17 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "build"
18 verbose node v12.13.0
19 verbose npm v6.12.0
20 error code ELIFECYCLE
21 error errno 2
22 error my-project#1.0.0 build: `webpack --mode development`
22 error Exit status 2
23 error Failed at the my-project#1.0.0 build script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 2, true ]
Just had the same problem. Make sure your main (index) HTML file,is "in" the src file

I'm trying to install all npm modules in ../AppData/Roaming folder. But each time it fails with error code - 4068

I'm simply using the following command: "npm install -g". OS: Windows 8.1, CMD is administrator. Error log:
0 info it worked if it ends with ok
1 verbose cli [ 'C:\Program Files\nodejs\\node.exe',
1 verbose cli 'C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js',
1 verbose cli 'install',
1 verbose cli '-g' ]
2 info using npm#2.5.1
3 info using node#v0.12.1
4 verbose node symlink C:\Program Files\nodejs\node.exe
5 silly cache add args [ '.', null ]
6 verbose cache add spec .
7 silly cache add parsed spec { raw: '.',
7 silly cache add scope: null,
7 silly cache add name: null,
7 silly cache add rawSpec: '.',
7 silly cache add spec: 'C:\',
7 silly cache add type: 'local' }
8 error addLocal Could not install C:\
9 verbose stack Error: EISDIR, read
9 verbose stack at Error (native)
10 verbose cwd C:\
11 error Windows_NT 6.3.9600
12 error argv "C:\Program Files\nodejs\\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "install" "-g"
13 error node v0.12.1
14 error npm v2.5.1
15 error code EISDIR
16 error errno -4068
17 error EISDIR, read
18 error If you need help, you may report this error at:
18 error http://github.com/npm/npm/issues
19 verbose exit [ -4068, true ]
It appears as though you are running npm install -g from your C: drive. npm has absolutely no idea what you want it to install unless you:
pass it arguments, like how npm install -g npm will globally install npm
run it in a directory that contains a package
Since you are not passing the command any arguments, npm assumes you want it to install what is in your current working directory. Since you do not have a package at the root of your C: drive, npm correctly errors out with the EISDIR error ("error: is directory").

Issue in starting Node App on Windows 7

I am using windows 7 and I have installed node.js and express.
After I create a project using express using the command below
> express projectName
A new project is created and after that to install dependencies I do
> npm install
All works good so far. but when I try to start the application
> npm start
Below is the issue I get in the npm-debug.log file. Please suggest whats wrong here. I have tried many other threads but solution found there work for me.
0 info it worked if it ends with ok
1 verbose cli [ 'C:\\Program Files\\nodejs\\\\node.exe',
1 verbose cli 'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli 'start' ]
2 info using npm#1.4.28
3 info using node#v0.10.33
4 verbose node symlink C:\Program Files\nodejs\\node.exe
5 verbose run-script [ 'prestart', 'start', 'poststart' ]
6 info prestart NodeTestApp#0.0.0
7 info start NodeTestApp#0.0.0
8 verbose unsafe-perm in lifecycle true
9 info NodeTestApp#0.0.0 Failed to exec start script
10 error NodeTestApp#0.0.0 start: `node ./bin/www`
10 error spawn ENOENT
11 error Failed at the NodeTestApp#0.0.0 start script.
11 error This is most likely a problem with the NodeTestApp package,
11 error not with npm itself.
11 error Tell the author that this fails on your system:
11 error node ./bin/www
11 error You can get their info via:
11 error npm owner ls NodeTestApp
11 error There is likely additional logging output above.
12 error System Windows_NT 6.1.7601
13 error command "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "start"
14 error cwd C:\Users\Ali\Desktop\NodeTestApp
15 error node -v v0.10.33
16 error npm -v 1.4.28
17 error syscall spawn
18 error code ELIFECYCLE
19 error errno ENOENT
20 verbose exit [ 1, true ]
child_process.spawn() returns ENOENT when it can't find the requested executable; in this case, node.exe. Looking closely at the log, we can see that npm start is attempting to run node app.js.
Is node on your PATH? What happens if you just type node app.js on the command line?
Try this.It's working for me on Windows 7 32 bit node.js
Create new blank folder for your project.Go to your project folder and create manually npm folder (don't use command line).
Then try again create new project.
Hope this help.

Resources