Closed mylastore closed 5 years ago
Hi @mylastore!
If you can produce a simple repro repo I'll try to spot the issue for ya :)
@jdalton Thanks for the quick response I have this project hope you can test it here by simply running npm start that is where I added esm like this "start": "node -r esm gulp",
https://github.com/mylastore/nodeshop
I don't see esm
in use in nodeshop
.
Would you please create a branch with what you're trying to do?
OOPS forgot to push, just push the new package.json
Now I get
Error: Cannot find module '/Users/johndavid.dalton/projects/nodeshop/gulp'
just push package.json again added another esm as a starting script so is not confusing.
exactly that's what I get to. If you run npm run gulp that works but if you run npm run esm does not work and get cannot find module '../../gulp'
"scripts": {
"start": "gulp",
"esm": "node -r esm gulp",
"gulp": "gulp",
That is because npm does some behind the scenes magic to resolve the local bin of gulp
since it's a dep. When you explicitly call node you have to provide it a proper path.
node -r esm ./node_modules/gulp/bin/gulp.js
ah good to know wow thank you for your time and this awesome project
I am using gulp 4 with a task that run my main.js, I added the esm via the index.js configuration example and pointing to the main.js but when I run gulp Is complaining that I need to install @babel/register or babel-register plus it also does not recognize import statements and I am sure at this point esm is not loaded, also try this on package.json
nodemon -r esm gulp
but get this