-
I have node js express web site for local. now today i want to build and it does not have any builder in my repo, so tries parcel but somehow it fail to build. ealier what I have is node.js and express.js which render few pages on start of npm run start. now according to parcel there should be a "source" key, tried but dient work then use. but it is giving babel error. ###package.json {
"name": "workshop",
"version": "1.0.0",
"description": "fun of colors",
"main": "start.js",
"scripts": {
"start": "nodemon --watch . --exec babel-node -- start.js",
"build": "parcel build index.js"
},
"author": "Keshav Mohta",
"license": "ISC",
"dependencies": {
"@babel/core": "^7.21.4",
"@babel/polyfill": "7.4.4",
"@babel/register": "^7.15.3",
"body-parser": "^1.20.2",
"express": "^4.18.2"
},
"devDependencies": {
"@babel/cli": "^7.21.0",
"@babel/node": "7.2.2",
"@babel/preset-env": "7.4.4",
"eslint": "5.16.0",
"eslint-config-airbnb-base": "13.1.0",
"eslint-plugin-import": "2.17.2",
"nodemon": "^2.0.22",
"parcel": "^2.8.3"
}
} .babelrc
and when run
@parcel/transformer-babel: Cannot find package '@parcel/babel-preset-env' imported from D:\Developer\workshop\babel-virtual-resolve-base.js here is the screenshot. so my question is how to fix it and what changes I need to do in my code also make it work? here is branch link Thanks. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Do you literally mean that your babelrc is empty? Otherwise, if you've specified |
Beta Was this translation helpful? Give feedback.
Do you literally mean that your babelrc is empty? Otherwise, if you've specified
@parcel/babel-preset-env
, then you also need to add that package as a regular npm dependency.