Meteor NPM : Couldn't run `npm shrinkwrap` - meteor

I've looked high and low for how to fix this, couldn't figure it out.
Running a React - Meteor app, meteorhacks:npm and browserify.
Error:
While building package npm-container:
error: couldn't run `npm shrinkwrap`: Command failed: npm ERR! Error: Problems were encountered
npm ERR! Please correct and try again.
npm ERR! missing: react#^0.14.7, required by react-addons-transition-group#0.14.7
npm ERR! missing: react#^0.14.7, required by react-addons-update#0.14.7
npm ERR! missing: react#^0.14.7, required by react-addons-create-fragment#0.14.7
npm ERR! missing: react#^0.14.7, required by react-addons-pure-render-mixin#0.14.7
npm ERR! at shrinkwrap_
Packages.json
{
"externalify" : "0.1.0",
"react-tap-event-plugin": "0.2.2",
"react-mixin" : "3.0.3",
"material-ui" : "0.13.4",
"formsy-react" : "0.17.0",
"formsy-material-ui" : "0.3.3"
}
The strange thing though is I had this working, then once I tried updating from material-ui 0.13.4 to 0.14.4, the whole package stopped working. I then reverted back to 0.13.4 and the same error persisted. I've tried removing meteorhacks:npm and the npm-container folder, as well as clearing npm cache.
The error disappears if I downgrade material-ui to 0.13.1, though I'm still trying to fix as I need to upgrade to 0.14.

I finally solved it. The only way I found was to upgrade meteor to the 1.3 beta, which includes modules import, so I could remove npm-package.
There was a bit of refactoring, where you have to remove any packages which load react, import the relevant packages on every jsx file, and another small bug caused by material-ui (again) with npm (it loads react as well so you need to delete react folder from your_project/node_modules/material-ui/node_modules/react).

Related

Problem with CSS module not found when deploying to vercel

This is the error log. And I cannot for the life of me fix this. everything works fine in dev but on deployment it fails. :(
23:12:53.687 Failed to compile.
23:12:53.687 ModuleNotFoundError: Module not found: Error: Can't resolve '../../styles/Homebody.module.css' in '/vercel/workpath0/components/Home'
23:12:53.687 > Build error occurred
23:12:53.688 Error: > Build failed because of webpack errors
23:12:53.688 at /vercel/workpath0/node_modules/next/dist/build/index.js:15:918
23:12:53.689 at runMicrotasks (<anonymous>)
23:12:53.689 at processTicksAndRejections (internal/process/task_queues.js:93:5)
23:12:53.689 at async /vercel/workpath0/node_modules/next/dist/build/tracer.js:3:470
23:12:53.704 npm ERR! code ELIFECYCLE
23:12:53.704 npm ERR! errno 1
23:12:53.707 npm ERR! next_front#0.1.0 build: `next build && next export`
23:12:53.707 npm ERR! Exit status 1
23:12:53.707 npm ERR!
23:12:53.707 npm ERR! Failed at the next_front#0.1.0 build script.
23:12:53.707 npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
23:12:53.714 npm ERR! A complete log of this run can be found in:
23:12:53.714 npm ERR! /vercel/.npm/_logs/2021-02-24T23_12_53_708Z-debug.log
23:12:53.719 Error: Command "npm run build" exited with 1
One thing is to start all .module.css files with a capital letter. Sometimes. however, you will still get the same error. To make matters worse, the error keeps occurring for varying .module.css files. So sometimes you will get A.module.css not found, and another time you get B.module.css not found.
I then deleted node_modules and ran npm i. No result; same error.
What did work for me was to make a new project with:
yarn create next-app
…and then add all the files from the old module one by one while redeploying the app each time to check it still works.
This isn't elegant, but it's fast enough and it does the trick.
This is an old question but I hope I can help someone in the future!
I was able to solve this issue by moving my CSS module file out of a subfolder into the root Styles folder.
Before:
-Styles
--Pages
---FileName.module.css
After:
-Styles
--FileName.module.css

Unhandled JS Exception: Requiring unknown module "1"

How do I fix this error?
Unhandled JS Exception: Requiring unknown module "1". If you are sure the module exists, try restarting Metro. You may also want to run yarn or npm install.
I installed react-navigation, react-native-elements through npm when I believe the error occurred. So I uninstalled them and I still get the same error.
I also ran yarn and npm install
Here are my dependencies
"dependencies": {
"#react-native-firebase/app": "^8.2.0",
"#react-native-firebase/auth": "^8.2.0",
"react": "16.13.1",
"react-native": "0.63.0"
}
app.js and the error screen
hello you just need to put ctrl+c in your termial so you can stop the server
than tap
npm start
or
yarn start
You have some syntax error probably
Attach snippets of App.js and the exact error stack trace you are getting with screenshots if possible.
Setup your node_modules from scratch again
Execute these:
1. rm -r node_modules
2. rm package-lock.json
3. expo upgrade
4. npm start -c
And install your dependencies once again either with npm or yarn.
Note: Use any one (npm or yarn)

Unexpected version of dependency installed

My package.json file includes these lines:
"angularfire2": "^4.0.0-rc.1"
"firebase": "^4.1.3"
When I try to install this, I get a warning:
npm WARN angularfire2#4.0.0-rc0 requires a peer of firebase#^3.6.6 but none was installed.
So I tried changing the second line to "firebase": "^3.6.6" but then I get:
npm WARN angularfire2#4.0.0-rc.1 requires a peer of firebase#^4.0.0 but none was installed.
Now, I know I can fix this by removing the ^ from the first line, but I don't understand the behavior as it's currently written.
Why is it not only sometimes going back a version when it should only go forward, but also always picking the wrong one for the Firebase version?
Try npm install firebase#4.0.0 --save

Installing natural package in a meteor application

For having natural language processing facility. Have added natural node package in my application using "npm install natural". But after installation while running the application using "sudo meteor", got some error about ""ReferenceError: require is not defined"". After googling found that need to do following steps:
1) Remove node_modules on the top of the root of the application (Done this part)
2) Added "natural": "0.1.27" in packages.json file also
3) Install npm using ""mrt add npm"". But getting following error after installing it in the application, while using ""sudo meteor"".
=> Meteor 0.8.1.3 is available. Update this project with 'meteor update'.
Initializing mongo database... this may take a moment.
npm ERR! missing: rimraf#2.x, required by meteor-npm#0.1.10
npm ERR! missing: mkdirp#0.3.x, required by meteor-npm#0.1.10
npm ERR! not ok code 0
=> Errors prevented startup:
While building package router:
error: no such package: 'ui'
While building package npm:
error: couldn't read npm version lock information
=> Your application has errors. Waiting for file change.
Any pointers what should be done. Not getting anything, this error taking my whole time. Thanks in advance
To use NPM packages within your meteor application you need to first install meteor-npm
mrt add npm
You then have to add a packages.json file at the root of your project like so;
{
"natural": "0.1.27"
}
When this file changes, meteor will automatically update its dependencies.
You can then use var natural = Meteor.require("natural")

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

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

Resources