I am pretty new to this environment still and am trying to get up to speed on node.js modules and Laravel (5.1.11) as a whole, so...
I have a fresh install of Laravel implemented by the cPanel Installitron. I'm using PHPStorm to install all of the node modules via the provided package.json:
package.json
{
"private": true,
"devDependencies": {
"gulp": "^3.8.8"
},
"dependencies": {
"laravel-elixir": "^3.0.0",
"bootstrap-sass": "^3.0.0"
}
}
The error I get when I run the install is:
Cannot download "https://github.com/sass/node-sass/releases/download/v3.13.1/win32-x64-57_binding.node":
HTTP error 404 Not Found
I can understand why this would happen, seeing as that is an older version of node-sass, but how do I know what newer versions are compatible with the requested version of laravel-elixir? I didn't want to just install a newer version of node-sass because digging a deeper hole would make it harder for me to find a solution to my problem. What is the fix for this?
It looks like you can fix this by installing Windows Build Tools via this command:
npm install --global --production windows-build-tools
Then delete the project's node_modules folder and re-run npm install.
Just follow this official url well doc.: https://laravel.com/docs/5.3/elixir if you get any error. I just comment and i ll be here.
Related
so previously, I installed Typecript on my new macbook by running this command
sudo npm install typescript -g
and I got Typescript version 4.7.4. and then I want to deploy the function using this command
firebase deploy
unfortunately, there is a warning like this
WARNING: You are currently running a version of TypeScript which is
not officially supported by #typescript-eslint/typescript-estree.
You may find that it works just fine, or you may not.
SUPPORTED TYPESCRIPT VERSIONS: >=3.3.1 <4.1.0
YOUR TYPESCRIPT VERSION: 4.7.4
Please only submit bug reports when using the officially supported
version.
and then I downgrade to version 4.0.7, but unfortunately that warning still exist, it seems my app is still on v4.7.4 (cached ? ) I am sure I have changed the typescript version on package.json and I also check via terminal like the image below
but why my node app still have version v.4.7.4 ? not v.4.0.7 ? what should I do?
fiuhhh....after 2 days, I finally find the solution
I have to change the dependencies and also the devDependencies, especially these dependencies in the package.json
"dependencies": {
"firebase-admin": "^10.0.2",
"firebase-functions": "^3.18.0",
},
"devDependencies": {
"#typescript-eslint/eslint-plugin": "^5.12.0",
"#typescript-eslint/parser": "^5.12.0",
"eslint": "^8.9.0",
"eslint-config-google": "^0.14.0",
"eslint-plugin-import": "^2.25.4",
"typescript": "^4.5.4" // <-- watch this version
},
the problem is ....it seems to me that these dependencies is tightly coupled. it can easily break if it doesn't match. so my solution is to create new project just to copy and paste those dependencies combination above with the latest version recommended by firebase. watch this video if you are confused how to initialize cloud function project
first, Update your firebase tools to the latest version using this command
sudo npm install -g firebase-tools
and change to your directory and init the project
cd desktop
mkdir forCopyPasteDependenciesOnly
firebase init
select cloud function and typescript. and then you copy those dependencies above and paste it on your problematic project
in my case, I also change the typescript globally using the recommended typescript version from the project package.json that you just initialize (4.5.4, not 4.0.7 or 4.7.4 in my case )
sudo npm uninstall -g typescript
sudo npm install -g typescript#4.5.4
and then, in your problematic project, delete your node-modules folder
and delete your package-lock.json. and finally run these 2 commands below
npm cache clean –force
npm install
and when you run firebase deploy you may see errors, but luckily it just error from eslint you just update, you can solve it easily.
I hope it helps
You installed typescript as globally on your system but you changed just in your package.json.
First you should type this npm uninstall -g typescript.
Then npm install -g typescript#your version.
After that you can uninstall your local tsc on your project.
I have recently updated a project where the last udpate was about a month ago, but failed to deploy to the server. After some investigation, it is because it is stuck in npm install, or more precisely, stuck at a line saying
This sutck happens on different package when trying on different machine, so it seems to be related to npm instead of any package.
I have made no changes to the package.json, only on some other javascript files. Also, the last deploy was about a month ago. In other words, the npm install can be run without problem last month.
This problem can be replicated by copying the package.json file to an empty folder and run npm install. The package.json file:
{
"private": true,
"devDependencies": {
"gulp": "^3.9.1",
"laravel-elixir": "^6.0.0-14",
"laravel-elixir-webpack-official": "^1.0.2",
"node-sass": "^4.5.3"
},
"dependencies": {
"eventemitter3": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-1.2.0.tgz"
}
}
I am using node 11.15.0, npm 6.7.0 through nvm. As it is a running project on live, upgrading or downgrading node and npm version is not an option without some careful planning, and seems to be an overkill at the moment.
For reference, I noticed that there is an outage in npmjs registory recently, but it seems to be fixed, so I am not sure if it is related. Have anyone had similar problem recently? Or any suggestion on how to solve this problem?
Have anyone been in this situation before ?
I run my code with CI/CD
after nest build, it gives me error :
node_modules/#types/superagent/index.d.ts:23:10 - error TS2305: Module '"buffer"' has no exported member 'Blob'. 23 import { Blob } from "buffer";
I don't know why? Please share if you got a solution for this one.
We had the same problem after upgrading nest 7.5.x to 8.0.0. The dependency "supertest" for "nestjs/testing" has a dependency on "#types/supertest" which wildcards "#types/superagent": "*", and that dependency has another wildcard dependency "#types/node": "*", but the types within #types/supertest actually require #types/node >=16.X.X.
So nestjs/testing -> supertest -> #types/supertest -> #types/superagent -> #types/node >= 16.X.X is your problem and error.
The comments mentioned are accurate because these package managers wildcard their dependencies to get the latest version of dependencies. They should but do not add peerDependencies with dependencies requirements such as "#types/node": "">=12.0.0 <16.0.0". Instead they say anything, "#types/node": "*" so the error is post package install, no npm warnings/errors. "It worked yesterday but not today" is your big red flag because when you ran npm install, with these wildcard dependencies even though you did not know it installed the latest version. Since it installed everything wildcard today, but not yesterday, it worked yesterday.
In addition, but also important is that you are have pinned #types/node <16.0.0 thus your error in combination with the other package changes.
One option: revert your package-lock.json changes and run npm ci
Another option: set your package.json dependency for #types/node to -> "#types/node": "^16.0.0",.
Another option: accept that wildcards are wrong and you don't trust what is going on there so pin the #types/superagent dependency to the one prior.
As for me and my family, we use nestjs with AWS lambda which runtime does not include nodejs 16, and not everyone on my team runs npm ci we more typically run npm install so the solution was
package.json
...
"devDependencies": {
...
"#types/node": "14.18.2",
"#types/superagent": "4.1.10",
"#types/supertest": "^2.0.11",
...
Upgrading #types/node to ^14.18.10 and typescript to ^3.9.10 worked for me.
"devDependencies": {
"#types/node": "^14.18.10",
"typescript": "^3.9.10"
},
Found on this discussion from Github
downgrading #types/superagent from v15.x.x to 14.1.14 solved the issue for me. v15 had some performance issues at the typing of this message
"npm i --save #types/superagent#4.1.14" did the trick
One tip is use npm view to get some info.
If you type
npm view #types/node
That shows the ts version compatibility. In my case, Is had to upgrade #types/node to 14.14.31, because I'm using ts 3.4.2.
if you have installed the npm, then delete the node_module file and use yarn install to add the new node_module and vice versa.
I'm attempting to upgrade React Native and I'm running into the following:
error: bundling: UnableToResolveError: Unable to resolve module `react/lib/ReactComponentTreeHook` from `/Users/anthony/dev/apptova-react/node_modules/react-native/Libraries/Performance/Systrace.js`: Module does not exist in the module map or in these directories:
/Users/anthony/dev/apptova-react/node_modules/react-native/node_modules/react/lib
, /Users/anthony/dev/apptova-react/node_modules/react/lib
I'm so confused. I can't find any library named ReactComponentTreeHook in node_modules, anywhere.
I've tried removing the node_modules folder and reinstalling, nada. I've also cleared watchman watches and reset the packager cache.
EDIT: I kept running into issues that seemed to stem from react-native-maps so I so I reset back to a working stable version, uninstalled react-native-maps, and ran react-native-git-upgrade (again).
Now I'm getting:
error: bundling: UnableToResolveError: Unable to resolve module `react/lib/ReactDebugCurrentFrame` from `/Users/anthony/dev/apptova-react/node_modules/react-native/Libraries/Renderer/src/renderers/shared/stack/reconciler/ReactCompositeComponent.js`: Module does not exist in the module map or in these directories:
/Users/anthony/dev/apptova-react/node_modules/react-native/node_modules/react/lib
, /Users/anthony/dev/apptova-react/node_modules/react/lib
I'm just trying to latest, my package.json dependencies are simple so I don't think its conflicts with a third-party code base:
"dependencies": {
"react": "15.4.1",
"react-native": "^0.43.1",
"react-native-drawer": "^2.3.0"
},
"devDependencies": {
"babel-jest": "18.0.0",
"babel-plugin-transform-flow-strip-types": "^6.21.0",
"babel-preset-react-native": "1.9.1",
"deepmerge": "^1.3.2",
"flow-bin": "^0.37.4",
"jest": "18.0.0",
"react-test-renderer": "15.4.1"
},
Again, went throught the process of clearing watchman watches, node modules, reseting package manager and still get this error.
EDIT 2: After spending two solid days of trying to get this working I created a new blank project and migrated my code over.
Make sure version in your package.json file is the version you want.
For example, "react-native: ^0.43.3" is not same as "react-native: 0.43.3".
Clean up and re-install everything.
If the error still there, then try to install react-native-git-upgrade
$ npm install -g react-native-git-upgrade
and then run
$ react-native-git-upgrade x.y.z(version you want to upgrade to)
for me it works.
If your version is too old, then you should follow the old version document to upgrade.
This could also happen if you don't have the correct version of react required by the version of react-native. If this is the case, you would get a warning like this when you run npm install.
npm WARN react-native#0.43.4 requires a peer of react#16.0.0-alpha.6 but none was installed.
To fix this problem, stop the react packager and upgrade the version of react by running the following command
npm install -save react#16.0.0-alpha.6
Now, re-run the app and hopefully the issue would go away.
I think recently many of the modules under react/lib were moved to react-dom/lib, which is why the packager can't find some modules
I followed following steps and it's working
• Deleted node_modules folder
• Replaced ^16.0.0-alpha.6 with "react": "16.0.0-alpha.3"
• npm install
• react-native run-android
It has been pretty frustrating finding the solution to this problem today, as I've tried searching on Google and went to all of different forums and websites in search of a solution, but none of them worked for me.
Is there anyone who could tell me what I could try in order to solve this?
Facts:
Fresh Laravel installation
Ran npm install
Ran npm install gulp
Ran gulp
Got this error
package.json contents
{
"private": true,
"devDependencies": {
"gulp": "^3.8.8"
},
"dependencies": {
"laravel-elixir": "^4.0.0",
"bootstrap-sass": "^3.0.0"
}
}
try to remove the node_modules directory completely and issue npm install or npm install --no-bin-links without gulp, gulp should already included in packages.json
Very old question I know, but, if still having issue...
Try to run
npm install laravel-elixir --save-dev
command manually on prompt.
And then make sure you added following code line in gulpfile.js file
var elixir = require('laravel-elixir');