I was running an Electron project, and everything worked just fine. But now when I run any of the scripts in my package.json (including npm start), it just escapes a line and doesn't do anything.
My package.json:
{ "name": "interclip-desktop", "version": "0.0.7", "description": "Interclip for desktop", "repository": "https://github.com/aperta-principium/Interclip-desktop", "main": "main.js", "scripts": { "start": "electron .", "package-mac": "electron-packager . --overwrite --asar=true --platform=darwin --arch=x64 --icon=assets/icons/mac/icon.icns --prune=true --out=release-builds", "package-win": "electron-packager . Interclip --overwrite --platform=win32 --arch=ia32 --icon=assets/icons/win/icon.ico --prune=true --out=release-builds --version-string.CompanyName=CE --version-string.FileDescription=CE --version-string.ProductName=\"Interclip\"", "package-linux": "electron-packager . Interclip --overwrite --asar=true --platform=linux --arch=x64 --icon=assets/icons/png/icon.png --prune=true --out=release-builds", "win-install": "node installers/windows/createinstaller.js", "postinstall": "electron-builder install-app-deps", "build": "electron-builder --linux", "release": "electron-builder --linux --publish always" }, "keywords": [ "Desktop", "Interclip" ], "author": "Filip Troníček", "license": "MIT", "devDependencies": { "electron": "^7.1.2", "electron-builder": "^22.1.0", "electron-installer-dmg": "^3.0.0", "electron-packager": "^14.1.1", "electron-reload": "^1.5.0", "electron-winstaller": "^4.0.0" }, "dependencies": { "axios": "^0.19.0", "mousetrap": "^1.6.3" }, "build": { "appId": "com.aperta-principium.interclip", "productName": "Interclip", "mac": { "category": "public.app-category.utilities" }, "dmg": { "icon": false }, "linux": { "target": [ "AppImage" ], "category": "Utility" } } }
I tried updating NPM, didn't work. When I tried in different projects, also doesn't work.
Thanks in advance
Check the ignore-script config If you see the start script is present inside your package. json file but still can't run the script, you need to check the console output. If there's no output at all, then you may have the ignore-scripts npm configuration set to true .
Run npm update -g npm. Execute this command by running the command prompt as Administrator npm install -g windows-build-tools. Run npm install inside the project folder where the package. json file is located, if it doesn't work run: npm install --force.
The Npm command not found error can appear when you install or upgrade npm. On Windows, the cause of this error could be that a PATH or system variable is not correctly set. The error can also occur if you do not have npm or Node. js installed, have an outdated version, or have permission issues.
npm run sets the NODE environment variable to the node executable with which npm is executed. If you try to run a script without having a node_modules directory and it fails, you will be given a warning to run npm install , just in case you've forgotten.
npm has a ignore-scripts
configuration key. It's expected value is a Boolean and it's set to false
by default.
Perhaps it has inadvertently been set to true
.
To get
/set
the ignore-scripts
configuration you can utilize the npm-config command:
Check its current setting by running:
npm config get ignore-scripts
If the aforementioned command returns true
then reset it to false
by running:
npm config set ignore-scripts false
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With