nodemon installed but not working on win10 - nodemon

I have installed nodemon (tried locally, globally and as dev dependencies), I get the message that nodemon is properly installed:
+ nodemon#1.19.0
updated 1 package and audited 2357 packages in 24.027s
found 0 vulnerabilities
My package.json file looks like this:
{
"name": "tests-node",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"dependencies": {
"express": "^4.16.4"
},
"devDependencies": {
"nodemon": "^1.19.0"
}
}
But when I run it, I get the message that nodemon does not exist (the message is in french):
'nodemon' n’est pas reconnu en tant que commande interne
ou externe, un programme exécutable ou un fichier de commandes.

I usually do it like this:
Change your "scripts" in package.json like this:
"scripts": {
"start": "node server/index.js",
"dev": "nodemon server/index.js"
},
and then start nodemon with npm run dev.
npm run start will the normal node server, and dev the nodemon.

Related

Dependencies aren't being included on the build output of electron forge

My electron app project uses create-react-app and my main process needed the electron-devtools-installer module. I'm using electron-forge for building the app. Now after running npm run make to package and built the app, I'm getting this error message
Error: Cannot find module 'electron-devtools-installer'
after opening the app. I'm not getting this error when I simply run electron ., thus I suspect the module is not being included on the packaging.
Now the said module is for development only, I could simply write a logic to ignore it when in production mode but what happens when I really need a 3rd party modules in my main process in the production, so how do I include the dependencies modules in the packaging?
I moved the electron-devtools-installer mode in dependencies key in package.json but it still doesn't work.
My package.json contains:
{
"name": "myapp",
"version": "0.1.0",
"private": true,
"homepage": ".",
"description": "some description",
"main": "main/init.js",
"author": "anonymouse",
"license": "MIT",
"dependencies": {
"#testing-library/jest-dom": "^5.16.5",
"#testing-library/react": "^13.4.0",
"#testing-library/user-event": "^13.5.0",
"electron-devtools-installer": "^3.2.0",
"electron-squirrel-startup": "^1.0.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-scripts": "5.0.1",
"web-vitals": "^2.1.4"
},
"scripts": {
"start": "electron-forge start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject",
"dev": "concurrently -k \"react-scripts start\" \"npm:electron\"",
"electron": "wait-on tcp:3000 && electron .",
"package": "react-scripts build && electron-forge package",
"make": "react-scripts build && electron-forge make",
"clean:winbuild": "rmdir build /s /q & rmdir out /s /q"
},
"eslintConfig": {
"extends": [
"react-app",
"react-app/jest"
]
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
},
"devDependencies": {
"#electron-forge/cli": "^6.0.0-beta.67",
"#electron-forge/maker-deb": "^6.0.0-beta.67",
"#electron-forge/maker-rpm": "^6.0.0-beta.67",
"#electron-forge/maker-squirrel": "^6.0.0-beta.67",
"#electron-forge/maker-zip": "^6.0.0-beta.67",
"concurrently": "^7.4.0",
"dotenv": "^16.0.3",
"electron": "^21.1.1",
"eslint": "^8.25.0",
"eslint-config-google": "^0.14.0",
"eslint-config-standard": "^17.0.0",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-n": "^15.3.0",
"eslint-plugin-promise": "^6.1.0",
"eslint-plugin-react": "^7.31.10",
"wait-on": "^6.0.1"
},
"config": {
"forge": "./forge.config.js"
}
}
My forge.config.js:
module.exports = {
packagerConfig: {
ignore: [
/coverage.*/,
/node_modules.*/,
/public.*/,
/src.*/,
/\.env|\.gitignore|.*bak|eslint.*|package-lock.*|(?<!build.*)\.txt|(?<!build.*)\.md/
]
},
makers: [
{
name: '#electron-forge/maker-squirrel',
config: {
name: 'bkkgapp'
}
},
{
name: '#electron-forge/maker-zip'
}
]
}

Netlify deploy issue on build

site link - https://react-chat-page.netlify.app/
github - https://github.com/mrshawnhum/chat-app
I have recently added a redirect file to fix a bug when you refresh the site and I added automatic deploys with netlify-cli to my project. The first time I added Yarn Run Build and received an exit code 127 when attempting to deploy. I manually changed it on netlify to Yarn Build and still receive the same message. I also attempted to clear the cache and manually deploy the site and still receive the same message.
"name": "client",
"version": "0.1.0",
"private": true,
"dependencies": {
"#testing-library/jest-dom": "^4.2.4",
"#testing-library/react": "^9.3.2",
"#testing-library/user-event": "^7.1.2",
"font-awesome": "^4.7.0",
"netlify-cli": "^2.58.0",
"query-string": "^6.13.1",
"react": "^16.13.1",
"react-dom": "^16.13.1",
"react-emoji": "^0.5.0",
"react-router": "^5.2.0",
"react-router-dom": "^5.2.0",
"react-scripts": "3.4.1",
"react-scroll-to-bottom": "^3.0.0",
"socket.io-client": "^2.3.0"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"postbuild": "cp_redirects ./build/",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": "react-app"
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
}
}
Netlify will start the build from the root folder of your git repo by default, which doesn't have your package.json file in it, and so Netlify doesn't know how to run yarn.
You can change that in the UI settings, see here.

Module not found: Error: Can't resolve 'hello.bundle.js' in 'D:\webpackDemo'

I am new to webpack.my situation is that: i try to use webpack for managing hello.js file.
hello.js
function hello(str){
alert(str);
}
package.json
{
"name": "webpackdemo",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"devDependencies": {
"webpack": "^4.1.1"
}
}
when i used
webpack hello.js hello.bundle.js
I get error in webstorm terminal
ERROR in multi ./hello.js hello.bundle.js
Module not found: Error: Can't resolve 'hello.bundle.js' in 'D:\webpackDemo'
# multi ./hello.js hello.bundle.js
It seems like, that the documentation is outdated, but try it like this using the -o flag (output.filename):
webpack ./hello.js -o hello.bundle.js --mode development
Use --mode production for production.

How to change nodemon default start file?

i have a web-application. I want to use nodemon with it. To start my application need to run 'node ./bin/www', but nodemon default run another file. And my web-applications doesn't aviable.
When i type in cmd
nodemon
i got:
[nodemon] 1.14.10
[nodemon] to restart at any time, enter `rs`
[nodemon] watching: *.*
[nodemon] starting `node app.js`
but i want change default start file from node app.js to node ./bin/www
How can i do this?
package.json
{
"name": "loc8r",
"version": "0.0.0",
"private": true,
"scripts": {
"start": "node ./bin/www"
},
"dependencies": {
"body-parser": "~1.18.2",
"cookie-parser": "~1.4.3",
"debug": "~2.6.9",
"express": "~4.15.5",
"jade": "~1.11.0",
"mongoose": "4.13.9",
"morgan": "~1.9.0",
"nodemon": "^1.14.9",
"readline": "1.3.0",
"request": "^2.83.0",
"serve-favicon": "~2.4.5"
},
"main": "app.js",
"devDependencies": {},
"author": "",
"license": "ISC",
"description": ""
}
nodemon should pick up what ever file is in "main": "file_to_be_executed.js", so if www is your file to be executed, change: "main": "app.js", to: "main": "./bin/www",

parse server deploying to aws

I am trying to deploy deploy my parse server, parse server dashboard, etc to aws. I am sure that the problem that I am experiencing is quite simple and it has to do with how I am packaging my ab node apps. I am downloading the git repo and then uploading the zip to my eb instance. It is in turn giving me this error.
After downloading a repository, such as parse server, what do I need to do to put it on elastic bean stalk? I already have the parse server example running on aws. I am just trying to upgrade versions.
here is my package.JSON file
{
"name": "parse-server",
"version": "2.2.16",
"description": "An express module providing a Parse-compatible API server",
"main": "lib/index.js",
"repository": {
"type": "git",
"url": "https://github.com/ParsePlatform/parse-server"
},
"files": [
"bin/",
"src/",
"public_html/",
"views/",
"LICENSE",
"PATENTS",
"README.md"
],
"license": "BSD-3-Clause",
"dependencies": {
"babel-polyfill": "6.8.0",
"babel-runtime": "6.6.1",
"bcrypt-nodejs": "0.0.3",
"body-parser": "1.15.2",
"colors": "1.1.2",
"commander": "2.9.0",
"deepcopy": "0.6.3",
"express": "4.14.0",
"intersect": "1.0.1",
"lodash": "4.12.0",
"lru-cache": "4.0.1",
"mailgun-js": "0.7.10",
"mime": "1.3.4",
"mongodb": "2.1.18",
"multer": "1.1.0",
"parse": "1.9.0",
"parse-server-fs-adapter": "1.0.0",
"parse-server-push-adapter": "1.0.4",
"parse-server-s3-adapter": "1.0.4",
"parse-server-simple-mailgun-adapter": "1.0.0",
"pg-promise": "5.2.0",
"redis": "2.6.2",
"request": "2.73.0",
"request-promise": "4.0.1",
"semver": "^5.2.0",
"tv4": "1.2.7",
"winston": "2.2.0",
"winston-daily-rotate-file": "1.1.5",
"ws": "1.1.1"
},
"devDependencies": {
"babel-cli": "6.8.0",
"babel-core": "6.10.4",
"babel-istanbul": "0.11.0",
"babel-plugin-syntax-flow": "6.8.0",
"babel-plugin-transform-flow-strip-types": "6.8.0",
"babel-preset-es2015": "6.6.0",
"babel-preset-stage-0": "6.5.0",
"babel-register": "6.8.0",
"codecov": "1.0.1",
"cross-env": "2.0.0",
"deep-diff": "0.3.4",
"gaze": "1.1.0",
"jasmine": "2.4.1",
"mongodb-runner": "3.3.2",
"nodemon": "1.9.2"
},
"scripts": {
"dev": "npm run build && node bin/dev",
"build": "./node_modules/.bin/babel src/ -d lib/",
"pretest": "cross-env MONGODB_VERSION=${MONGODB_VERSION:=3.2.6} MONGODB_STORAGE_ENGINE=mmapv1 ./node_modules/.bin/mongodb-runner start",
"test": "cross-env NODE_ENV=test TESTING=1 ./node_modules/.bin/babel-node $COVERAGE_OPTION ./node_modules/jasmine/bin/jasmine.js",
"test:win": "npm run pretest && cross-env NODE_ENV=test TESTING=1 ./node_modules/.bin/babel-node ./node_modules/babel-istanbul/lib/cli.js cover -x **/spec/** ./node_modules/jasmine/bin/jasmine.js && npm run posttest",
"posttest": "./node_modules/.bin/mongodb-runner stop",
"coverage": "cross-env COVERAGE_OPTION='./node_modules/babel-istanbul/lib/cli.js cover -x **/spec/**' npm test",
"start": "node ./bin/parse-server",
"prepublish": "npm run build"
},
"engines": {
"node": ">=4.3"
},
"bin": {
"parse-server": "./bin/parse-server"
}
}
You have to physically go into the repository and compress it into a new zip file. For some reason it would not accept zip files that I downloaded off of github.