npm: "Error: invalid version: 1.0" while installing grunt plugins - gruntjs

While yesterday all works fine, today i am getting the printed error below, when i try to install a grunt plugin, wether it is a official grunt contrib or vendor plugin.
I am running grunt v0.4, node v0.8.20 and npm v1.2.11, System X 10.8.2.
npm install grunt-<plugin>-<name> --save-dev
npm ERR! Error: invalid version: 1.0
npm ERR! at validVersion (/usr/local/lib/node_modules/npm/node_modules/read-package-json/read-json.js:590:40)
npm ERR! at final (/usr/local/lib/node_modules/npm/node_modules/read-package-json/read-json.js:342:23)
...
What suprises me is that also official grunt contrib plugins (grunt-contrib-xxx) fails to install altough i expect it has a proper semver version syntax. npm-debug.log shows nothing additional to the verbose output in the console.
Any hints are appreciated.
Thx in advance
felic

Sorry for replying this late.
I am new to the grunt/nodejs stuff, so I was a bit confused and it took a while to understand what's wrong: I updated grunt to 0.4.~ at that point without editing the related project package.json to reflect the correct grunt versioning ("1.0.0" instead of "0.1.0"). Thanks for your help.

Modify package.json to
"devDependencies" : {
"grunt" : "latest"
}
Now run
sudo npm install
This installs latest grunt.
[Note : Add required dependencies to object and the command will install it all on run]

since grunt 0.4 is aimed at the v1 of node maybe the plugin you're trying to install asks for a 1.0 version of node, try to read the package.js of the plugins yo're trying to install.
as glortho asked, you could tell us explicitely what plugin causes the problem

Related

Something went wrong installing JavaScript dependencies, check your npm logfile or run npm install again manually [duplicate]

I am using react native and Expo. I am unable to build new app because after I use expo init appName it shows the following error.
Heres the full message:
📦 Using npm to install packages. You can pass --yarn to use Yarn instead.
√ Downloaded and extracted project files.
× Something when wrong installing JavaScript dependencies. Check your npm logs. Continuing to initialize the app.
✅ Your project is ready!
To run your project, navigate to the directory and run one of the following npm commands.
- cd Scanner
- npm start # you can open iOS, Android, or web from here, or run them directly with the commands below.
- npm run android
- npm run ios # requires an iOS device or macOS for access to an iOS simulator
- npm run web
I tried multiple times to create a blank project, also tried npm install to install failed/not downloaded libraries and continue after failure but it showed another error:
npm ERR! code Z_BUF_ERROR
npm ERR! errno -5
npm ERR! zlib: unexpected end of file
also tried npm cache verify that showed cache is ok Content verified: 3562 (252580364 bytes).
So, How can I solve this issue?
Problems related to npm installation are very common If you do any mistake in early installation, but is avoided. Learn more about npm tree.
Steps worked for me are :
npm cache clean --force
npm cache verify
npm -g uninstall expo-cli --save
npm install expo-cli --global
expo init app-name
cd app-name
npm start
Always run as administrator if working on Windows and in root directory.
The solutions above didn't work for me but if you use 'npm install' in the directory of the app you get a clue that you shuold try 'npm install --force'
err message
You should have all these files folders and files at the start of the project otherwise not all the dependencies have been installed which is why we were getting the problem.folder structure
After you have added --force to npm install you have all the dependencies installed. Now you can run the app with npm start.
Unfortunately, all the solutions described above didn't work on my machine...
Here is my latest solution for this problem...
This worked 100% on my machine...
Use npm i -g expo-cli
This will automatically add the required packages and also remove the unnecessary ones.
Yes, surely, you don't need to uninstall and re-install it again.
Just follow my steps.
And, you can create your expo project using expo init.
I hope my solution will help you out from this annoying problem....
I just did npm install and it worked for me, but I had do that every time I create a new expo project.
I also encountered this problem, and finally found that it was the problem of react native cli,I installed the latest version of react native cli,Expo is back to normal
This Error is regarding to the git account. expos need a git account to setup react native project
If you are using windows you need to install git in your local PC
after that open your Terminal and type this command
git config --global user.name "your_username"
git config --global user.email "your_email_address#example.com"
after that clone any github project to your local computer. it will ask to login to Github
after all these steps try expo init <projectname>
The simple way to settle that error is by using "expo-cli init app-name" instead of "expo init app-name".
I tried and worked perfectly for me. Hope it will help you guys.
i have faced a similar problem and running yarn set version 1.22.1 fix it
Run the Command Prompt as an administrator. And run the following command:
npx create-expo-app AwesomeProject

ESLint couldn't find the config "google" to extend from. Please check that the name of the config is correct

I'm trying to deploy a cloud function on firebase. I'm successfully logged into firebase CLI from osx terminal. When I go to deploy it kicks back this error.
Oops! Something went wrong! :(
ESLint: 7.19.0
ESLint couldn't find the config "google" to extend from. Please check that the name of the config is correct.
it's because you didn't do the install
Would you like to install them now with npm? · No / Yes
you can try again configuring json .eslint or you can do it this way
npm install eslint-config-google --save-dev
As explained here: https://eslint.org/docs/user-guide/configuring/configuration-files#using-a-configuration-from-a-plugin
The extends property value can consist of:
plugin:
the package name (from which you can omit the prefix, for example, react is short for eslint-plugin-react)
/
the configuration name (for example, recommended)
Meaning, if you extend your config using the google plugin like this in your .eslintrc.yml:
extends:
- google
you have to install it doing:
npm install eslint-config-google --save-dev
I had the same issue, While trying to debug my error I happen to make some changes in the below code, reverting it back to this way removed the error
Please check in your .eslintrc.js ,if the below code is there or not
extends: ["eslint:recommended", "google"],
Most likely you do not have eslint installed so try to install it by running this command:
npm install eslint-config-eslint --save-dev
After making sure that ESLint is installed, you just need to initialize it by running:
eslint --init
I had this issue and resolved mine running this:
npm install eslint-config-eslint --save-dev
Most likely you didn't have eslint-config-google installed.
Once installed try running ESLint again.

Warning: StringMap expected string key Use --force to continue

grunt build command failed with following results
Please help me....
NOTE:
ngAnnotate:dist reading happened but after that writing is not happening...
bower minification is working. controllers,services js files unable to ngAnnotate
None of controller have any ES6 features (no arrow funtion ==>, no Let,const keywords used to declare)
my package.json file has below modules
I was using "grunt-ng-annotate": "1.0.1" and got the same error. I tried to upgrade but it didn't work.
Since I needed a quick fix, I had to downgrade to 0.10.0 and now it's working fine.
I removed the current version: npm uninstall grunt-ng-annotate --save-dev
And installed the older one: npm install grunt-ng-annotate#0.10.0 --save-dev
I hope it helps!

Grunt release : Warning: Task "release" not found and it shows "aborted due to warnings"

Grunt release : Warning: Task "release" not found and shows aborted due to warnings.
But it shows hint like "Use --force to continue". If i use "--force" to the command it is working fine. What's happening when i use --force before and after.
Double check that all the dependencies for your project are properly installed by running npm install. If there's errors, update your question with that information.
If that does not resolve the problem, check package.json for the grunt-release plugin. It will be found under dependencies or devDependencies. If it's missing from package.json, run npm install grunt-release --save-dev to install the plugin and save it to your project dependencies.
If any errors occur while attempting to resolve your problem this way, update your question and include that information.

Npm module "grunt-contrib-imagemin" not found, Is it installed?

I run into this error, when I try to do build a project with "grunt build".
There seems to be no problem when I test the project by doing "grunt server".
The project has been scaffolded and managed with: yeoman/grunt/bower. In Windows.
Everything went well and then a week ago or so it started doing this. I can't build projects no more.
When I try to install the module doing:
npm install grunt-contrib-imagemin
It can never install it, get the following "weird" error.
Any hints please?
Ok I found a way to solve this:
In your package.json, add "jpegtran-bin": "0.2.0" before the reference to imagemin
Delete the node_modules folder in your project, and run "npm install" and "bower install" again
There seem to be an issue with the jpegtran's latest version.
!! - Please note this is just a workarround waiting for the bugfix.
Like the program suggests, you need to install the npm module.
npm i --save-dev grunt-contrib-imagemin
Considering you're on Windows you might want to take a look at the project's GitHub repo for additional installation instructions.
There's an issue with a package contrib-imagemin references that prevents it from properly installing on Windows.
GitHub issue on grunt-contrib-imagemin: https://github.com/gruntjs/grunt-contrib-imagemin/issues/109
GitHub pull request on the offending library: https://github.com/yeoman/node-jpegtran-bin/pull/38
For now, you can manually specify "jpegtran-bin": "0.2.0" in your package.json and it should function as a workaround. If it's a pain point for you, go comment on that pull request and perhaps it'll convince the project maintainer to actually take a look and comment as well.
I had the same problem with 0.3.0 version, but once I updated to 0.4.0 the problem was solved. Check your package.json. Hope that helps!
"grunt-contrib-imagemin": "~0.4.0",
As of May 2015 I solved this by deleting node_modules and running npm install.
I am using windows, I was getting same error.
So I edited the Environmental Variables.
Just add: C:\Ruby200-x64\bin to your PATH variable and restart node prompt.
The imagemin install seems to not run correctly when called by grunt-contrib-imagemin. I just do
cd ./node_modules/grunt-contrib-imagemin/node_modules/imagemin
npm install
And then it's fine.
On Ubuntu 14.04.3 LTS, package.json containing:
"grunt-contrib-imagemin": "~0.4.0",
I had to reinstall Grunt (but the jpegtran-bin workaround, or just removing node_modules and running npm install wasn't enough, I needed the following (with sudo):
rm -rf node_modules/
sudo npm update -g npm
sudo npm install -g grunt-cli

Resources