How I can solve npm installtion problem to laravel project - laravel

when i run npm i it returns the error.
C:\xampp\htdocs\personal\freshShop>npm i
**
npm WARN deprecated popper.js#1.16.1: You can find the new Popper v2 at #popperjs/core, this package is dedicated to the legacy v1
npm WARN deprecated chokidar#2.1.8: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
npm WARN deprecated fsevents#1.2.13: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
npm WARN deprecated resolve-url#0.2.1: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated urix#0.1.0: Please see https://github.com/lydell/urix#deprecated
npm ERR! Unexpected end of JSON input while parsing near '...3ec2605d1fc435f4d8651' **
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Najmun_Nafiz\AppData\Roaming\npm-cache\_logs\2020-06-04T02_02_30_082Z-debug.log

Delete node_modules, 'package-lock.json' and clean your npm cache via:
npm cache clean --force

I solved this exact issue by upgrading my NodeJS version to 14.x.

Related

Github action: npm install -> Error: Process completed with exit code 1

I have this GitHub action workflow that have been working for over a year. Suddenly I get error when I get to the step that runs 'npm install'. I really have no clue why the error is triggered. Would really appreciate someone helping or at least just pointing me in right direction. If you need some more data just tell me I will edit the question.
I have tried updating some packages and also the npm update command. But no good:
Run npm install
npm WARN old lockfile
npm WARN old lockfile The package-lock.json file was created with an old version of npm,
npm WARN old lockfile so supplemental metadata must be fetched from the registry.
npm WARN old lockfile
npm WARN old lockfile This is a one-time fix-up, please be patient...
npm WARN old lockfile
npm WARN deprecated urix#0.1.0: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated uuid#3.4.0: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.
npm WARN deprecated resolve-url#0.2.1: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated querystring#0.2.0: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
npm WARN deprecated request#2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated har-validator#5.1.5: this library is no longer supported
npm WARN deprecated svgo#1.3.2: This SVGO version is no longer supported. Upgrade to v2.x.x.
npm WARN deprecated chokidar#2.1.8: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
npm WARN deprecated chokidar#2.1.8: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
npm WARN deprecated chokidar#2.1.8: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
npm WARN deprecated tar#2.2.2: This version of tar is no longer supported, and will not receive security updates. Please upgrade asap.
npm WARN deprecated popper.js#1.16.1: You can find the new Popper v2 at #popperjs/core, this package is dedicated to the legacy v1
npm WARN deprecated core-js#2.6.12: core-js#<3.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Please, upgrade your dependencies to the actual version of core-js.
npm ERR! code 1
npm ERR! path /home/runner/work/projsiteWebApp/projsiteWebApp/node_modules/node-sass
npm ERR! command failed
npm ERR! command sh -c node scripts/build.js
npm ERR! Building: /usr/local/bin/node /home/runner/work/projsiteWebApp/projsiteWebApp/node_modules/node-gyp/bin/node-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library=
npm ERR! make: Entering directory '/home/runner/work/projsiteWebApp/projsiteWebApp/node_modules/node-sass/build'
npm ERR! g++ '-DNODE_GYP_MODULE_NAME=libsass' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-
(some more error message in between here but had to cut off due to too many characters)
npm ERR! remove_cv
npm ERR! /home/runner/.node-gyp/16.13.1/include/node/v8-internal.h:492:38: error: ‘remove_cv_t’ is not a member of ‘std’
npm ERR! /home/runner/.node-gyp/16.13.1/include/node/v8-internal.h:492:38: note: suggested alternative: ‘remove_cv’
npm ERR! !std::is_same<Data, std::remove_cv_t<T>>::value>::Perform(data);
npm ERR! ^~~~~~~~~~~
npm ERR! remove_cv
npm ERR! /home/runner/.node-gyp/16.13.1/include/node/v8-internal.h:492:50: error: template argument 2 is invalid
npm ERR! !std::is_same<Data, std::remove_cv_t<T>>::value>::Perform(data);
npm ERR! ^
npm ERR! /home/runner/.node-gyp/16.13.1/include/node/v8-internal.h:492:63: error: ‘::Perform’ has not been declared
npm ERR! !std::is_same<Data, std::remove_cv_t<T>>::value>::Perform(data);
npm ERR! ^~~~~~~
npm ERR! /home/runner/.node-gyp/16.13.1/include/node/v8-internal.h:492:63: note: suggested alternative: ‘herror’
npm ERR! !std::is_same<Data, std::remove_cv_t<T>>::value>::Perform(data);
npm ERR! ^~~~~~~
npm ERR! herror
npm ERR! make: *** [Release/obj.target/binding/src/binding.o] Error 1
npm ERR! gyp ERR! build error
npm ERR! gyp ERR! stack Error: `make` failed with exit code: 2
npm ERR! gyp ERR! stack at ChildProcess.onExit (/home/runner/work/projsiteWebApp/projsiteWebApp/node_modules/node-gyp/lib/build.js:262:23)
npm ERR! gyp ERR! stack at ChildProcess.emit (node:events:390:28)
npm ERR! gyp ERR! stack at Process.ChildProcess._handle.onexit (node:internal/child_process:290:12)
npm ERR! gyp ERR! System Linux 5.4.0-1064-azure
npm ERR! gyp ERR! command "/usr/local/bin/node" "/home/runner/work/projsiteWebApp/projsiteWebApp/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
npm ERR! gyp ERR! cwd /home/runner/work/projsiteWebApp/projsiteWebApp/node_modules/node-sass
npm ERR! gyp ERR! node -v v16.13.1
npm ERR! gyp ERR! node-gyp -v v3.8.0
npm ERR! gyp ERR! not ok
npm ERR! Build failed with error code: 1
npm ERR! A complete log of this run can be found in:
npm ERR! /home/runner/.npm/_logs/2021-12-13T20_05_37_396Z-debug.log
Error: Process completed with exit code 1.
It looks like something in your project is using node-sass, which contains libsass which is deprecated
If it is a direct dependency, you can just switch over to Dart Sass, and things mostly should just work the same. If it is a transitive dependency that is requiring node-sass, you can try to update it by updating your direct dependencies that depend on it. Alternatively, if you're using yarn, you can try to change it with selective version resolutions
If you couldn't manage to switch to using dart-sass and have to deal with the C++ gyp build error, I would probably check to make sure that the particular version of node-sass you're using is compatible with the current c++ compiler you currently have installed. Maybe your compiler became too old because libsass (and in turn, node-sass) decided to up their language requirements?
Edit:
Try using this technique (since you are using npm) for resolving the node-sass that is inside vue-mj-daterangepicker to something else. You can change to a newer version or by using the "dart-sass" package. If you use the latter, g++ wouldn't error since dart-sass doesn't use c++. You could also use the "sass" package, since the sass and dart-sass npm pacakges are essentially the same
Maybe something like the following in your package.json... (not tested)
"resolutions": {
"node-sass": "https://registry.npmjs.org/node-sass/-/node-sass-7.0.0.tgz"
},
"scripts": {
"preinstall": "npx npm-force-resolutions"
}
or
"resolutions": {
"node-sass": "https://registry.npmjs.org/dart-sass/-/dart-sass-1.25.0.tgz"
},
"scripts": {
"preinstall": "npx npm-force-resolutions"
}
The reason that this is happening is because libsass seems to be set up to use the C++11 standard when it builds, but std::remove_cv_t was only introduced as part of the C++14 standard (I think some compilers like MSVC may have introduced it earlier than that). An easy fix is to set the CXXFLAGS environment variable before you run npm install. e.g. CXXFLAGS="--std=c++14" npm install

Getting error while install expo cli windows

I try install Expo cli from windows using npm but I get error
This is my code
npm install -g expo-cli
This the error what I got
PS E:\Code\LearnReactNative> npm install -g expo-cli
npm WARN deprecated #hapi/joi#17.1.1: Switch to 'npm install joi'
npm WARN deprecated #hapi/pinpoint#2.0.0: Moved to 'npm install #sideway/pinpoint'
npm WARN deprecated #hapi/address#4.1.0: Moved to 'npm install #sideway/address'
npm WARN deprecated #hapi/formula#2.0.0: Moved to 'npm install #sideway/formula'
npm WARN deprecated core-js#2.6.12: core-js#<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js#3.
npm WARN deprecated request#2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated har-validator#5.1.5: this library is no longer supported
npm WARN deprecated urix#0.1.0: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated resolve-url#0.2.1: https://github.com/lydell/resolve-url#deprecated
npm ERR! cb() never called!
npm ERR! This is an error with npm itself. Please report this error at:
npm ERR! <https://npm.community>
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Riky\AppData\Roaming\npm-cache\_logs\2021-04-12T13_33_17_039Z-debug.log
Can someone help me to fix it ? sory I'm new in npm :D
try below commands:-
npm cache clean --f
npm install -g expo-cli

In terminal 'tns preview' command not working. (NativeScript)

I wanted to run my NS application in local. I downloaded project from play.nativescript.org, And I open cmd with target path and I followed this steps
Step 1. Install the latest NativeScript CLI
Type the following command in a Command Prompt or Terminal.
npm install -g nativescript#latest
and I have successfully installed the NativeScript CLI
Step 2. Preview your app
Navigate to your project folder and run the following command to start
previewing your app.
tns preview
When I entered the command I get this errors
You are using the deprecated nsconfig.json file. Just be aware that NativeScript 7 has an improved nativescript.config.(js|ts) file for when you're ready to upgrade this project.
npm WARN deprecated bfj-node4#5.3.1: Switch to the `bfj` package for fixes and new features!
npm WARN deprecated request#2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated request#2.88.0: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated core-js#2.6.11: core-js#<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js#3.
npm WARN deprecated har-validator#5.1.5: this library is no longer supported
npm WARN deprecated urix#0.1.0: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated chokidar#2.1.8: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
npm WARN deprecated fsevents#1.2.13: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
npm WARN deprecated resolve-url#0.2.1: https://github.com/lydell/resolve-url#deprecated
npm ERR! code E404
npm ERR! 404 Not Found - GET https://github.com/thomasconner/javascript/tarball/67b7944366453a87226389d483ac1ad861e0e129npm ERR! 404
npm ERR! 404 'pubnub#https://github.com/thomasconner/javascript/tarball/67b7944366453a87226389d483ac1ad861e0e129' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404 It was specified as a dependency of 'kinvey-nativescript-sdk'
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\dotor\AppData\Roaming\npm-cache\_logs\2020-10-01T09_47_56_177Z-debug.log
Command npm.cmd failed with exit code 1
As in github.com therosko has written, making kinvey-nativescript-sdk version as 5.0.1 worked for me. Src: here
Unfortunately, play.nativescript.org exported projects won't run with nativescript version 7 and up.
Currently, the only solution would be to install {N} CLI using npm install -g nativescript#6.8.0

npm run watch on laravel 6 has many warning and errors

When I run npm install on Laravel 6
I get the following errors:
C:\Users\Hamid\Desktop\LaravelChatApp-master\laravel-chat-master>npm install
npm WARN deprecated babel-preset-es2015#6.24.1: � Thanks for using Babel: we recommend using babel-preset-env now: please read https://babeljs.io/env to update!
npm WARN deprecated fsevents#1.2.9: One of your dependencies needs to upgrade to fsevents v2: 1) Proper nodejs v10+ support 2) No more fetching binaries from AWS, smaller package size
npm WARN deprecated core-js#2.6.10: core-js#<3.0 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js#3.
npm WARN deprecated hawk#3.1.3: This module moved to #hapi/hawk. Please make sure to switch over as this distribution is no longer supported
and may contain bugs and critical security issues.
npm WARN deprecated browserslist#1.7.7: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.
npm WARN deprecated cryptiles#2.0.5: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).
npm WARN deprecated sntp#1.0.9: This module moved to #hapi/sntp. Please make sure to switch over as this distribution is no longer supported
and may contain bugs and critical security issues.
npm WARN deprecated hoek#2.16.3: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).
npm WARN deprecated boom#2.10.1: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).
> node-sass#4.13.0 postinstall C:\Users\Hamid\Desktop\LaravelChatApp-master\laravel-chat-master\node_modules\node-sass
> node scripts/build.js
Binary found at C:\Users\Hamid\Desktop\LaravelChatApp-master\laravel-chat-master\node_modules\node-sass\vendor\win32-x64-72\binding.node
Testing binary
Binary is fine
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#1.2.9 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#1.2.9: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
added 1107 packages from 781 contributors and audited 14707 packages in 526.859s
found 21 vulnerabilities (2 low, 12 moderate, 7 high)
run `npm audit fix` to fix them, or `npm audit` for details
And after I run npm audit fix --force then npm run watch return following errors:
Error: Cannot find module 'C:\Users\Hamid\Desktop\LaravelChatApp-master\laravel-chat-master\node_modules\cross-env\bin\cross-env.js'
←[90m at Function.Module._resolveFilename (internal/modules/cjs/loader.js:794:15)←[39m
←[90m at Function.Module._load (internal/modules/cjs/loader.js:687:27)←[39m
←[90m at Function.Module.runMain (internal/modules/cjs/loader.js:1025:10)←[39m
←[90m at internal/main/run_main_module.js:17:11←[39m {
code: ←[32m'MODULE_NOT_FOUND'←[39m,
requireStack: []
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! # watch: `node node_modules/cross-env/bin/cross-env.js NODE_ENV=development node_modules/webpack/bin/webpack.js --watch --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the # watch 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\Hamid\AppData\Roaming\npm-cache\_logs\2019-12-02T05_33_19_426Z-debug.log
I also cleared the npm cache several times and reinstall npm but problem not solve

Error installing Composer on Ubuntu

I am trying to install Composer on Ubuntu 14.04. I was able to install the prerequisites. When installing composer, I get the following error. How to fix it?
npm install -g composer-cli
npm WARN deprecated fs-promise#1.0.0: Use mz or fs-extra^3.0 with Promise Support
npm WARN deprecated crypto#0.0.3: This package is no longer supported. It's now a built-in Node module. If you've depended on crypto, you should switch to the one that's built-in.
npm WARN deprecated node-uuid#1.4.8: Use uuid module instead
npm WARN deprecated jade#1.11.0: Jade has been renamed to pug, please install the latest version of pug instead of jade
npm WARN deprecated transformers#2.1.0: Deprecated, use jstransformer
npm WARN deprecated nodemailer#2.7.2: All versions below 4.0.1 of Nodemailer are deprecated. See https://nodemailer.com/status/
/root/.nvm/versions/node/v6.11.2/bin/composer -> /root/.nvm/versions/node/v6.11.2/lib/node_modules/composer-cli/cli.js
> hashtable#2.0.2 install /root/.nvm/versions/node/v6.11.2/lib/node_modules/composer-cli/node_modules/hashtable
> node-gyp configure build
sh: 1: node-gyp: Permission denied
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#1.1.2 (node_modules/composer-cli/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#1.1.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! hashtable#2.0.2 install: `node-gyp configure build`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the hashtable#2.0.2 install 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! /root/.npm/_logs/2017-08-22T16_31_22_412Z-debug.log
So firstly you should not install Hyperledger Composer as 'root'. You need to read the docs here before you proceed https://hyperledger.github.io/composer/installing/development-tools.html
So fundamentally this is an npm issue (in that it causes problems for npm, when you npm install as 'root' or 'sudo' privileges for installing modules).
I suggest you create a non-root user in your Ubuntu system. Then log in as that user. Then install the pre-reqs using the supplied prereqs-ubuntu.sh script from the link above. Then follow the instructions, installing as your non-privileged user.
Normal route to fixing a non-root install npm issue, is one of these shown here https://docs.npmjs.com/getting-started/fixing-npm-permissions
When you install composer modules globally (eg. composer-cli) you should install using a designated, non-root user as mentioned. If there are issues (eg, on Ubuntu with permissions to write/update node directories located in system directories like /usr/local) - one solution (but see link earlier) is perform the npm install to a directory you have access to - rather than resort to root or superuser access, as this is not good practice. Here is what to do to set the npm prefix to a given directory, ...
"npm config set prefix /home/myuser/"
In this case, global binaries are placed in /home/myuser/bin which is in your PATH, and the modules are placed in /home/myuser/lib ...

Resources