This is my error image getting on heroku logs --tail
above is a given image of my errors. When I am trying to deploy my nodejs app Getting error on git push Heroku master .
.
.
.
Remote failed
working properly on local server. I am beginner please help my git id is cosmos-dx and there is a git repo of name Webdictionary
After reading through the nodemon docs, and taking the fact that you stated you are new, I think I know what is happening.
In the nodemon docs it gives you two ways to install, one is globally npm install -g nodemon and the other is to install it in the dev dependencies npm install --save-dev nodemon. Either of these options would make nodemon not be present if the build to heroku uses npm install --only=production. I assume they do that.
In your package.json file, change the npm start script to this:
"start": "node ser1.js"
As nodemon is not present in the heroku built application, your current start script will fail. If you want to continue using nodemon for local development you can add a new script:
"dev": "nodemon ser1.js"
From there to run your application, with nodemon, on your local machine you would run npm run dev
Related
I working on laravel project and I need run this command in the terminal in Cpanel npm run dev
Do have installed it? If so, try to find /node_modules/npm/bin/npm-cli.js and run it with full path starting root.
Like:/usr/lib/node_modules/npm/bin/npm-cli.js -v
I installed npm-run-all and also configured the environment variable (which may or may not be not required) on my Windows machine but am getting an error:
'npm-run-all' is not recognized as an internal or external command,
operable program or batch file
I am trying to build my current project with npm run build which includes the script where the error is thrown:
npm-run-all -p build-css build-webpack
Do I have to do any additional things to make it run?
Make sure the npm-run-all is in your package.json devDependencies.
If npm-run-all is present in your package.json, run npm i
If not present install it, run: npm i npm-run-all -D
If error is still present, follow these steps:
Remove node_modules folder: run rm -rf node_modules
Install all dependecies: run npm i
Hope this helps!
You may just need to run the following command first (from the directory with the package.json file)
npm install
Please do that like this.
npm i npm-run-all -g
And then this issue will be fixed.
You have a couple of options here, besides installing npm-run-all as a global package as suggested by #Vaibhav in the comments:
1) Create an NPM script
The package.json file has a scripts section which can used to define shortcuts for anything you need to run while you're working on your app. There are some pre-defined scripts, like run or test than can be executed with simply npm start/npm test or you can define anything you like and then run it with npm run my-script-name. You could try:
{
"scripts": {
"start": "npm-run-all -p build-css build-webpack"
}
}
Any NPM module referenced here "just works" (i.e. the path to the executable is resolved under the hood by NPM)
2) NPX
In newer versions of NPM (i.e. >= 5.2 or so), the "NPX" executable is provided. This has a similar effect to running commands inside an NPM script. You would run:
npx npm-run-all -p build-css build-webpack
Again, the path would be automatically resolved.
If you have an older NPM install, you can also install it separately:
npm install -g npx
npm install -g npm-run-all
Works for me.
Double check if npm-run-all is in your package.json devDependencies.
I had same problem while using code editor Brackets.
To resolve the error, I did the following steps.
Add nodejs new system variable to your PC under Control Panel -> System -> Advanced System Settings
;C:\Program Files\nodejs\
After that, re-run command:
npm
I don't know if this would help anyone, but I got this error because I was doing nodemon server.js instead of nodemon server/server.js. I wasn't in the right folder!
Did you reopen the terminal after you installed node?
If you have installed npm with the current terminal window open. Your terminal window will not have loaded the latest path settings (with npm location) to find the npm application to run the command. In this case try below steps .
Try closing the current terminal session.
Reopen a new session.
Try the command again ( will pick up the new path settings with npm installed)
This worked for me.
npm audit fix --force
Also you can try downgrading your autoprefixer, seems version 10.0.0 doesn't work well with postcss
npm i autoprefixer#9.8.6
I'm trying to use pusher.subscribe() on the server side, but Pusher is only for client side.
I found this: https://github.com/pusher/pusher-http-node
Which allows us to set up a pusher for the server side. However, the readme is outdated and I can't set it up.
Running this command
npm install pusher --prefix cloud/modules
Only creates: cloud/modules/etc and cloud/modules/node_modules.
This means I cant run
$ cd cloud/modules/pusher
$ npm run parse-build
Please help!
try to use cd cloud/modules/node_modules/pusher and then npm run parse-build it will create build for Parse cloud
'Creating build for Parse Cloud.' && webpack --config=./parse.webpack.js Creating build for Parse Cloud. sh: webpack: command not found
Install webpack using npm install -g webpack globally or locally to install webpack local for the project npm install -D to install all dev dependencies in your cd cloud/modules/node_modules/pusher directory.It is recommended to install webpack locally so that you need not to stick to a particular version for different projects.
You can't subscribe with Pusher you can only trigger and some other functions
if you want to subscribe from the server side(nodejs e.t.c)
use pusher-js
npm i pusher-js or yarn add pusher-js
I am trying to create new app with create-react-app.
Below is the error.
Please help. Thanks in advance
➜ REACT create-react-app my-app
Creating a new React app in /media/budi/Tjung/#TJUNG/REACT/my-app.
Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts...
yarn add v1.6.0
info No lockfile found.
[1/4] Resolving packages...
error An unexpected error occurred: "http://registry.npmjs.org/react: > ETIMEDOUT".
info If you think this is a bug, please open a bug report with the information provided in "/media/budi/Tjung/#TJUNG/REACT/my-app/yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.
Aborting installation.
yarnpkg add --exact react react-dom react-scripts --cwd /media/budi/Tjung/#TJUNG/REACT/my-app has failed.
Deleting generated file... package.json
Deleting generated file... yarn-error.log
Deleting my-app / from /media/budi/Tjung/#TJUNG/REACT
Done.
error image at CLI
Looks like network problem to me. You could be behind a proxy. If that is the case, configure your proxy in npm like this
npm config set proxy http://proxy_host:port
For https
npm config set https-proxy http://proxy.company.com:8080
Note: The https-proxy doesn't have https as the protocol, but http.
Optionally you can also try,
npm config set strict-ssl false
Checkout this SO answer
check if npm exists on your system.
try the commands in this order.
1. npm install --save create-react-app
2. create-react-app projectname
The name of the project must be in lowercase
Assuming that you have Node installed, you can use npm to install the create-react-native-app command line utility:
npm install -g create-react-native-app
Then run the following commands to create a new React Native project called "my-app":
create-react-native-app my-app
cd my-app
npm start
I have solve this problem.. it is about internet speed connection.
.
When I met this problem, I have spent one day to find out the solution. I read so many article about ETIMEDOUT. I had uninstall and re-install npm and yarn. Still doesn't solve my problem.
.
Until then I found the spot that has high speed internet connection. Fortunately I can create new app with create-react-app.
I think there are problem with your configurations of npm package.
Maybe somewhere, you set up some proxy configuration to npm variables.
You can reset configs running this script in terminal
sudo sh -c 'echo "" > $(npm config get globalconfig)'
and wait until process will end and run
exit
Open another terminal window and try
Im trying to deploy an nodejs app to eb, all my code is using the new js features.
On my package.json I have start command:
scripts : {
start: "babel-node bin/start.js"
}
this works fine on my localhost, when I deploy the app to EB, i get the error on the logs saying:
sh: babel-node: command not found
Can i run the babel-node command on a cloud server, or shall i compile my code before deployment.
Include babel-cli as a dependency in your package.json
You can do this by doing npm i babel-cli
However
That solves your problem but babel-node is not recommended for production use as stated in the usage docs