-
-
Notifications
You must be signed in to change notification settings - Fork 157
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error: Package exports for 'D:\development\project\node_modules\terser' do not define a valid './package.json' target #299
Comments
It looks like you just deleted our lovely crafted issue template. It was there for good reasons. Please help us solving your issue by answering the questions asked in this template. I'm closing this. Please either update the issue with the template and reopen, or open a new issue. Fill out all fields, I can't help you without information. |
@evilebottnawi whoops 😱 yea you are right, sorry about that 😞✊ I restarted VSCode and ran |
Update: I have added the repository where I'm having the issue. |
@evilebottnawi sorry for pinging you again but could you take a look at the following code? Feeling pretty dumb right now because I can't figure my issue out. webpack.config.js 'use strict';
const path = require('path');
const webpack = require('webpack');
const TerserPlugin = require('terser-webpack-plugin');
module.exports = {
context: path.resolve(__dirname, 'src'),
entry: [
'./app.js'
],
output: {
filename: '/app.js',
path: path.resolve(__dirname, 'dist'),
publicPath: '../'
},
optimization: {
minimize: true,
minimizer: [new TerserPlugin()],
},
} package.json {
"devDependencies": {
"terser-webpack-plugin": "^4.1.0",
"webpack": "^4.44.1",
"webpack-cli": "^3.3.12"
},
"scripts": {
"test": "webpack"
} src/app.js console.log('test'); full error:
|
Something breaks |
Tried it on my HDD and SSD, on both I get the same error. Like I said, with version |
It is the problem from |
It is the Node.js version. Tried it with |
Some version of |
Because you don't want to, am I right? |
@jerptrs Don't want what? It is bug on node side nodejs/modules#446, I can't fix it here, listing all requires testing all versions on CLI, test will be slow, each PR will be cost a lot of time, do you have time on this? Node.js recommend using LTS version if you wanna be stable |
Oh fml - thought 13.1.0 was an LTS version since I used NVM 🤷 I'm sorry 😞 Note to myself: thinking and then making a comment. |
Expected Behavior
Run without error and minify my Javascript code.
Actual Behavior
When running
webpack
it throws the following error:Error: Package exports for 'D:\development\project\node_modules\terser' do not define a valid './package.json' target
Code
dependencies
How Do We Reproduce?
https://github.com/jerptrs/romman.hamburg
Clone and run
npm run build
The text was updated successfully, but these errors were encountered: