Error running "npm start" and "npm install gulp" with Foundations - gulp

I am new to Foundation for Emails and I am just trying to get everything installed, following directions step by step. I have installed Git, and Node.js (the latest version 11.5.0).
I created my project directory (test123) and inside there I am told to run "npm start". I do this and get the following error:
Alexandrus-MacBook-Pro-2:test123 alexcrisan$ npm start
> foundation-emails-template#1.0.0 start. /Users/alexcrisan/Documents/sites/test123
> gulp
[09:27:55] Failed to load external module #babel/register
[09:27:55] Failed to load external module babel-register
[09:27:55] Failed to load external module babel-core/register
[09:27:55] Failed to load external module babel/register
[09:27:55] Local gulp not found in ~/Documents/sites/test123
[09:27:55] Try running: npm install gulp
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! foundation-emails-template#1.0.0 start: `gulp`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the foundation-emails-template#1.0.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm WARN Local package.json exists, but node_modules missing, did you mean to install?
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/alexcrisan/.npm/_logs/2018-12-26T14_27_55_973Z-debug.log
I follow the error code to install gulp, and get this:
Alexandrus-MacBook-Pro-2:test123 alexcrisan$ npm install gulp
npm ERR! code 1
npm ERR! Command failed: /usr/bin/git checkout 4.0
npm ERR! error: pathspec '4.0' did not match any file(s) known to git.
npm ERR!
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/alexcrisan/.npm/_logs/2018-12-26T15_03_01_008Z-debug.log
I found some similar answers online but couldn't find a straightforward way to solve this without digging myself into more confusion.
Running Mac OS Mojave (latest).
Thank you!

The git release name of gulp has changed from 4.0 to v4.0.0 which means that git cant find the node module to install it.
if you open your package.json and you should see something like:
"gulp": "github:gulpjs/gulp#4.0",
replace it with:
"gulp": "github:gulpjs/gulp#v4.0.0",
Then delete your node-modules folder and reinstall, it should run fine now.
I know how you feel, this had me confused for a while. To resolve it I looked at the released versions on github (https://github.com/gulpjs/gulp/releases) and used the v4.0.0 release in place of what was there.

Related

npm install errors with code ENOENT, syscall open, no such file or directory

I got the following errors every time I run npm install. How could I solve it?
npm ERR! code ENOENT
npm ERR! syscall open
npm ERR! path D:\CS\class\didipass/package.json
npm ERR! errno -4058
npm ERR! enoent ENOENT: no such file or directory, open 'D:\CS\class\didipass\package.json'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\ASUS\AppData\Local\npm-cache\_logs\2023-02-01T20_19_40_952Z-debug-0.log
I already update to the newest version of npm and I have tried npm cache clear but it doesn't work for me.
Thanks for helping me.
Make sure your terminal is in the right directory. Is your project nested in a folder by chance? The folder you are in in the terminal should be the same folder your project is DIRECTLY in.
In other words: make sure you cd into the direct container of your project. If the filetree looks like this:
my_projects > project_1 > [project content]
Make sure you are in project_1, and not in my_projects.
Let me know if this helps.

Error while trying to install mui core with npm

I just deployed a new create-react-app and still receiving this same error message. I installed MUI and am receiving a 'unable to resolve dependency tree'
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: eat-blended-web#0.1.0
npm ERR! Found: react#18.1.0
npm ERR! node_modules/react
npm ERR! react#"^18.1.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react#"^16.8.0 || ^17.0.0" from #material-ui/core#4.12.4
npm ERR! node_modules/#material-ui/core
npm ERR! #material-ui/core#"*" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR! See /Users/rodriguezmedia/.npm/eresolve-report.txt for a full report.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/rodriguezmedia/.npm/_logs/2022-05-13T00_57_27_262Z-debug-0.log
rodriguezmedia#Frankies-MacBook-Air-2 eat-blended-web %
instead of using "npm install #material-ui/core",
just refer to "npm install #mui/material"
and for mui icons just install "npm install #mui/icons-material".
for more details just go to "https://www.npmjs.com/package/#mui/icons-material" this page.
The error is telling you that the package you're trying to install has react#"^16.8.0 || ^17.0.0" in its peer dependencies, but you're currently using react#18.1.0.
You can get around this and install your package by including --legacy-peer-deps at the end of your command. For example:
npm install #mui/material --legacy-peer-deps
Keep in mind that peer dependencies are modules that the package is designed to work with. Using this flag to proceed with the installation can cause unintended and sometimes breaking changes. Since React 18 is new, some packages have not been updated to specifically include it in their peer dependencies.
Updated package names: #material-ui/core -> #mui/material
See more detail here: https://mui.com/material-ui/migration/migration-v4/#replace-all-imports
Please try this command
npm install #mui/material --legacy-peer-deps

npm ERR! Unexpected end of JSON input while parsing near '...#types/run-sequence":

npm ERR! Unexpected end of JSON input while parsing near '...#types/run-sequence":'
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Acer\AppData\Roaming\npm-cache_logs\2020-05-24T09_59_48_560Z-debug.log
× Package install failed, see above.
The Schematic workflow failed. See above.
When I create a new angular project using "ng new newApp", Above error occured. I tried so many solutions, but did not work.
I just uninstalled angular using the command,
npm uninstall -g #angular/cli
Then I cleared the cache using the following command,
npm cache clean --force
Then I reinstalled angular,
npm install -g #angular/cli
Then it worked successfully.

I Can't Run npm run script its showing many errors

I tried many times to run npm script I also added the script in the package.json file but its showing some errors actually I am building a website and I needed npm sass to make it but the npm run compile:sass which is my script is showing errors here's the image which is facing the problem.
Here's the script code:
{
"name":"natours",
"version":"1.0.0",
"description":"landing page for natours",
"main":"index.js",
"scripts":{
"compile:sass":"node-sass sass/main.scss css/style.css" <=====
},
"author":"Kishan",
"license":"ISC",
"devDependencies":{
"node-sass":"^4.9.0"
}
}
And here's the error in command prompt:
C:\Users\ANONYMOUS>npm run compile:sass
npm ERR! path C:\Users\ANONYMOUS\package.json
npm ERR! code ENOENT
npm ERR! errno -4058
npm ERR! syscall open
npm ERR! enoent ENOENT: no such file or directory, open 'C:\Users\ANONYMOUS\package.json'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\ANONYMOUS\AppData\Roaming\npm-cache_logs\2018-06-17T05_39_21_109Z-debug.log C:\Users\ANONYMOUS>
You are missing a comma between node-sass sass/main.scss and css/style.css
it should be node-sass sass/main.scss, css/style.css
It seems the problem is with locating the file, not the formatting of the file or the content that error should be thrown later if necessary.
Are you sure that your package.json is in the folder you are running the command from? Try the "dir" console command in the shell where you are executing "npm start" to check if it is.
Also, depending on what editor you are using I used to make a mistake when I started programming of saving files with the wrong format especially something like package.json.txt if using notepad.

Elastic Beanstalk fails at start script

I'm trying to deploy a Node.js app to elastic beanstalk. The problem is, it fails at the start script every time. I have ec2 configured to use the start script npm start, which executes node app.js (defined in package.json). However, this start script fails in ec2. I get the logged error,
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the myProject start script 'node app.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the Portfolio package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node app.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs myProject
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls myProject
npm ERR! There is likely additional logging output above.
What does this mean? Running npm start on my command line in the root directory of the same app that was zipped to AWS works fine, running on localhost. I also have updated both npm and node.js
Here is the file structure zipped to deploy:
.zip
node_modules/
public/
app.js
package.json
package-lock.json
I faced a problem with similar symptoms on Elastic Beanstalk which was caused by missing npm dependencies. Some dependencies were installed locally in node_modules, but one or two we're installed globally, causing them not to be packaged when zipping for deployment. Unfortunately Elastic Beanstalk's error message is less than helpful in this case and gives a generic error.