React app: npm run build throws "sh: cross-env: command not found" even after running npm i - npm

I have been unable to run the command npm run build unsuccessfully, I get the following issue:
> #myer-online/frontend#1.0.0 build /Users/surbhimidha/myer-online
> cross-env NODE_ENV=production next build
sh: cross-env: command not found
npm ERR! code ELIFECYCLE
npm ERR! syscall spawn
npm ERR! file sh
npm ERR! errno ENOENT
npm ERR! #myer-online/frontend#1.0.0 build: `cross-env NODE_ENV=production next build`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the #myer-online/frontend#1.0.0 build 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! /Users/surbhimidha/.npm/_logs/2021-02-10T08_06_42_019Z-debug.log
I am using the following versions of node and npm:
npm: 6.14.8
node: 14.13.1
I have tried to delete node modules and run npm i but still I get the above error when I run npm run build
I noticed that cross-env is not present under /node_modules/.bin
Please help!

Related

npm install code 1 error git dep preparation failed

Has anyone hit the error below when trying to install NPM?
npm ERR! code 1
npm ERR! git dep preparation failed
npm ERR! command /home/user1/.nvm/versions/node/v15.12.0/bin/node /home/user1/.nvm/versions/node/v15.12.0/lib/node_modules/npm/bin/npm-cli.js install --force --cache=/home/user1/.npm --prefer-offline=false --prefer-online=false --offline=false --no-progress --no-save --no-audit --include=dev --include=peer --include=optional --no-package-lock-only --no-dry-run
npm ERR! npm WARN using --force Recommended protections disabled.
npm ERR! npm ERR! code 1
npm ERR! npm ERR! The git reference could not be found
npm ERR! npm ERR! command git --no-replace-objects checkout 4.0
npm ERR! npm ERR! error: pathspec '4.0' did not match any file(s) known to git
npm ERR!
npm ERR! npm ERR! A complete log of this run can be found in:
npm ERR! npm ERR! /home/user1/.npm/_logs/2021-07-27T07_22_59_809Z-debug.log
npm ERR! A complete log of this run can be found in:
npm ERR! /home/user1/.npm/_logs/2021-07-27T07_24_31_341Z-debug.log
In my case I got that error while using node v16.13.0. After I switched to v10.24.1, it got solved.
I'm on In Windows 10 with node 16.
For me, the solution was either running commands
set NODE_ENV=development
$env:NODE_ENV="development"
or calling the npm install command with admin rights inside PowerShell
By the way, when I switched to node v12, it worked for me as well.

I don't know what going on

I just want to know what is going, whenever I download some react code from github (because I want to check the output for inspiration) and run it using npm start, I see this in the terminal.
What should I do?
sh: react-scripts: command not found
npm ERR! code ELIFECYCLE
npm ERR! syscall spawn
npm ERR! file sh
npm ERR! errno ENOENT
npm ERR! todo-react#0.1.0 start: `react-scripts start`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the todo-react#0.1.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm WARN Local package.json exists, but node_modules missing, did you mean to install?
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/markcornejo/.npm/_logs/2021-05-20T09_35_52_922Z-debug.log
Marks-Air:todo-react-master markcornejo$
Run npm install before npm start, to ensure all the dependencies are installed.

error while running "npm run build" in vue application

I have cloned vue application from git hub(https://github.com/jimmerioles/progressive-weather-app), for automating the deployment in jenkins. Before doing it, i am checking in my ubuntu machine(GCP vm). There i have installed java,nodejs, npm and vuecli. When i execute a command "npm run build" getting the below error. I tried re-installing vuecli, nodejs and npm also., still getting the same error. Kindly let me know how can i fix this.
npm version is "6.2.0", nodejs version is "v14.3.0" and vuecli is a latest one.
root#instance-2:~/weather/src# npm run build
> PWeatherApp#0.1.0 build /root/weather
> vue-cli-service build
sh: 1: vue-cli-service: not found
npm ERR! code ELIFECYCLE
npm ERR! syscall spawn
npm ERR! file sh
npm ERR! errno ENOENT
npm ERR! PWeatherApp#0.1.0 build: `vue-cli-service build`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the PWeatherApp#0.1.0 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm WARN Local package.json exists, but node_modules missing, did you mean to install?
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2020-05-23T18_32_20_092Z-debug.log
its may help you:
npm install -g #vue/cli
# OR
yarn global add #vue/cli

error command failed to execute ... npm install

I followed http://www.phoenixframework.org/docs/installation to install Phoenix on a current Debian system but can't get it to work. When I want to create a new Phoenix application I get the following error:
abc#xyz:~$ mix phoenix.new test10
* creating test10/config/config.exs
[...]
* creating test10/web/views/page_view.ex
Fetch and install dependencies? [Yn] Y
* running npm install && node node_modules/brunch/bin/brunch build
* error command failed to execute, please run the following command
again after installation:
"npm install && node node_modules/brunch/bin/brunch build"
[...]
If I then run the npm install I get this:
abc#xyz:~/test10$ npm install
npm ERR! addLocal Could not install /home/abc/test10/deps/phoenix
npm ERR! addLocal Could not install /home/abc/test10/deps/phoenix_html
npm ERR! Linux 3.16.0-4-amd64
npm ERR! argv "/usr/bin/nodejs" "/home/abc/.npm-global/bin/npm" "install"
npm ERR! node v6.5.0
npm ERR! npm v3.10.6
npm ERR! path /home/abc/test10/deps/phoenix
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall open
npm ERR! enoent ENOENT: no such file or directory,
open '/home/abc/test10/deps/phoenix'
npm ERR! enoent ENOENT: no such file or directory,
open '/home/abc/test10/deps/phoenix'
npm ERR! enoent This is most likely not a problem with npm itself
npm ERR! enoent and is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! Please include the following file with any support request:
npm ERR! /home/abc/test10/npm-debug.log
abc#xyz:~/test10$
What do I have to do to fix this?
Running mix deps.get did the trick:
abc#xyz:~/test10$ mix deps.get
Could not find Hex, which is needed to build dependency :phoenix
Shall I install Hex? (if running non-interactively, use: "mix local.hex --force") [Yn] Y
* creating /home/abc/.mix/archives/hex-0.13.0
Running dependency resolution
Dependency resolution completed
connection: 1.0.4
[...]

Aurelia Typescript skeleton -navigation error with npm start command

I'm using Node 6.3 and npm 3.10.3
I'm successfully able to run the command of npm install but when i execute npm start I get the following error
I'm referring to this github repo https://github.com/aurelia/skeleton-navigation/tree/master/skeleton-typescript-webpack
Error is
npm ERR! Windows_NT 10.0.10586 npm ERR! argv "C:\Program
Files\nodejs\node.exe" "C:\Program
Files\nodejs\node_modules\npm\bin\npm-cli.js" "run" "server:dev"
npm ERR! node v6.3.0 npm ERR! npm v3.10.3 npm ERR! code ELIFECYCLE
npm ERR! aurelia-skeleton-navigation-webpack#1.0.0-beta.3.0.1
server:dev: cross-env NODE_ENV=development node
./node_modules/webpack-dev-server/bin/webpack-dev-server --inline
--progress --profile --watch npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the aurelia-skeleton-navigation-webpack#1.0.0-beta.3.0.1
server:dev script 'cross-env NODE_ENV=development node
./node_modules/webpack-dev-server/bin/webpack-dev-server --inline
--progress --profile --watch'. npm ERR! Make sure you have the latest version of node.js and npm installed. npm ERR! If you do, this is most
likely a problem with the aurelia-skeleton-navigation-webpack package,
npm ERR! not with npm itself. npm ERR! Tell the author that this fails
on your system: npm ERR! cross-env NODE_ENV=development node
./node_modules/webpack-dev-server/bin/webpack-dev-server --inline
--progress --profile --watch npm ERR! You can get information on how to open an issue for this project with: npm ERR! npm bugs
aurelia-skeleton-navigation-webpack npm ERR! Or if that isn't
available, you can get their info via: npm ERR! npm owner ls
aurelia-skeleton-navigation-webpack npm ERR! There is likely
additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! D:\Afzal.Qureshi\My
Projects\AureliaTs\skeleton-navigation-master\skeleton-typescript-webpack\npm-debug.log
npm ERR! Windows_NT 10.0.10586 npm ERR! argv "C:\Program
Files\nodejs\node.exe" "C:\Program
Files\nodejs\node_modules\npm\bin\npm-cli.js" "start" npm ERR!
node v6.3.0 npm ERR! npm v3.10.3 npm ERR! code ELIFECYCLE npm ERR!
aurelia-skeleton-navigation-webpack#1.0.0-beta.3.0.1 start: npm run
server:dev npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the
aurelia-skeleton-navigation-webpack#1.0.0-beta.3.0.1 start script 'npm
run server:dev'. npm ERR! Make sure you have the latest version of
node.js and npm installed. npm ERR! If you do, this is most likely a
problem with the aurelia-skeleton-navigation-webpack package, npm ERR!
not with npm itself. npm ERR! Tell the author that this fails on your
system: npm ERR! npm run server:dev npm ERR! You can get
information on how to open an issue for this project with: npm ERR!
npm bugs aurelia-skeleton-navigation-webpack npm ERR! Or if that isn't
available, you can get their info via: npm ERR! npm owner ls
aurelia-skeleton-navigation-webpack npm ERR! There is likely
additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! D:\My
Projects\AureliaTs\skeleton-navigation-master\skeleton-typescript-webpack\npm-debug.log
It seems that you're using the nightly version of the skeleton. Be sure to pull a release version.
https://github.com/aurelia/skeleton-navigation/tree/1.0.0-beta.3.0.1/skeleton-typescript-webpack