i want to install rollup-plugin-visualizer but its need to update rollup.
updated rollup from 1.8.0 to 3.1.0
got error
[!] RollupError: Node tried to load your configuration file as CommonJS even though it is likely an ES module. To resolve this, change the extension of your configuration to ".mjs", set "type": "module" in your package.json file or pass the "--bundleConfigAsCjs" flag.
delete node-modules folder and package-lock.json and install again npm i
got error
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: #bet-core/ui#2.4.0
npm ERR! Found: rollup#3.1.0
npm ERR! node_modules/rollup
npm ERR! dev rollup#"^3.1.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer rollup#">=0.60.0 <3" from rollup-plugin-babel#4.4.0
npm ERR! node_modules/rollup-plugin-babel
npm ERR! dev rollup-plugin-babel#"^4.3.2" from the root project
rollup-plugin-babel npm page says !!!
đź’ˇ This package has been deprecated and is no longer maintained. Please use #rollup/plugin-babel.
i have delete rollup-plugin-babel then install #rollup/plugin-babel.
now i got this error
[!] RollupError: Node tried to load your configuration file as CommonJS even though it is likely an ES module. To resolve this, change the extension of your configuration to ".mjs", set "type": "module" in your package.json file or pass the "--bundleConfigAsCjs" flag.
Original error: Cannot use import statement outside a module
can someone tell me where to look for this error solutions?
i have find the solution.
At first changed format from 'esm' to 'cjs' in rollup.config.js
export default {
...
output: [
{
format: 'cjs',
...
},
]
};
then rollup.config.js changed to rollup.config.mjs
Hi man I have the same issue running "npm run rollup"
RollupError: Node tried to load your configuration file as CommonJS even though it is likely an ES module. To resolve this, change the extension of your configuration to ".mjs", set "type": "module" in your package.json file or pass the "--bundleConfigAsCjs" flag.
What I found:
https://github.com/rollup/rollup/issues/4619
https://github.com/rollup/rollup/pull/4621
-You can try out this pull request locally by installing Rollup vi
npm install rollup/rollup#esm-load-config
or load it into the REPL:
https://rollupjs.org/repl/?pr=4621
this might work either: https://github.com/rollup/rollup/blob/master/docs/01-command-line-reference.md
If you're using node v14 upgrade it to v16, this works in my case, especially when you run Rollup in GitHub Action:
name: Release #vueup/vue-quill
on:
push:
branches:
- alpha
- beta
- master
paths:
- 'packages/vue-quill/**'
jobs:
release:
name: Build and release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout#v3
- uses: actions/setup-node#v3
with:
node-version: 16
- name: Install root deps
run: npm ci
- name: Install package deps
working-directory: packages/vue-quill
run: npm ci
- name: Release package
working-directory: packages/vue-quill
run: npx ts-node ../../scripts/release.ts vue-quill
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
Related
When I want to use the npm package manager for js we package or project like this command:
npm start
It shows me :
npm ERR! code E418
npm ERR! 418 Unknown - GET https://repo.huaweicloud.com/repository/npm/yarn
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Amir\AppData\Local\npm-cache\_logs\2021-12-08T13_04_36_000Z-debug.log
I think my npm mirror is wrong, how can I fix it?
You can use
npm config --global edit
and
npm config edit, it will open the npm config with your default editor.
and then remove the registry line for each file to reset it to defaults.
Trying to build my app with target: 'serverless' in next.config.js (In-order to deploy on AWS Lambda).
When running npm run build I'm getting the following output:
Warning: Built-in CSS support is being disabled due to custom CSS configuration being detected.
See here for more info: https://err.sh/next.js/built-in-css-disabled
info - Using external babel configuration from C:\Users\User\Desktop\mysite\.babelrc
info - Creating an optimized production build
warn - Compiled with warnings
./node_modules/require_optional/index.js
Critical dependency: the request of a dependency is an expression
./node_modules/node-pre-gyp/lib/pre-binding.js
Critical dependency: the request of a dependency is an expression
./node_modules/node-pre-gyp/lib/util/versioning.js
Critical dependency: the request of a dependency is an expression
./node_modules/node-fetch/lib/index.js
Module not found: Can't resolve 'encoding' in 'C:\Users\User\Desktop\mysite\node_modules\node-fetch\lib'
./node_modules/mongodb/lib/operations/connect.js
Module not found: Can't resolve 'mongodb-client-encryption' in 'C:\Users\User\Desktop\mysite\node_modules\mongodb\lib\operations'
./node_modules/node-pre-gyp/lib/util/compile.js
Module not found: Can't resolve 'node-gyp' in 'C:\Users\User\Desktop\mysite\node_modules\node-pre-gyp\lib\util'
./node_modules/node-pre-gyp/lib/util/compile.js
Module not found: Can't resolve 'npm' in 'C:\Users\User\Desktop\mysite\node_modules\node-pre-gyp\lib\util'
./node_modules/node-pre-gyp/lib/util/nw-pre-gyp/index.html 1:0
Module parse failed: Unexpected token (1:0)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
> <!doctype html>
| <html>
| <head>
> Build error occurred
Error: package.json does not exist at C:\package.json
at Object.module.exports.wr/F.exports.find (C:\Users\User\Desktop\mysite\.next\serverless\pages\_error.js:188263:15)
at Object.<anonymous> (C:\Users\User\Desktop\mysite\.next\serverless\pages\_error.js:154078:28)
at Object.paWE (C:\Users\User\Desktop\mysite\.next\serverless\pages\_error.js:154141:30)
at __webpack_require__ (C:\Users\User\Desktop\mysite\.next\serverless\pages\_error.js:23:31)
at Object.xDbK (C:\Users\User\Desktop\mysite\.next\serverless\pages\_error.js:189175:64)
at __webpack_require__ (C:\Users\User\Desktop\mysite\.next\serverless\pages\_error.js:23:31)
at Object.gL7F (C:\Users\User\Desktop\mysite\.next\serverless\pages\_error.js:123042:67)
at __webpack_require__ (C:\Users\User\Desktop\mysite\.next\serverless\pages\_error.js:23:31)
at Module.IlR1 (C:\Users\User\Desktop\mysite\.next\serverless\pages\_error.js:53618:12)
at __webpack_require__ (C:\Users\User\Desktop\mysite\.next\serverless\pages\_error.js:23:31)
at Module.ScIc (C:\Users\User\Desktop\mysite\.next\serverless\pages\_error.js:81256:17)
at __webpack_require__ (C:\Users\User\Desktop\mysite\.next\serverless\pages\_error.js:23:31)
at C:\Users\User\Desktop\mysite\.next\serverless\pages\_error.js:91:18
at Object.<anonymous> (C:\Users\User\Desktop\mysite\.next\serverless\pages\_error.js:94:10)
at Module._compile (internal/modules/cjs/loader.js:1133:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1153:10)
info - Collecting page data .npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! client#0.1.0 build: `next build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the client#0.1.0 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\User\AppData\Roaming\npm-cache\_logs\2020-09-12T19_38_11_418Z-debug.log
What is the meaning of this error?
Error: package.json does not exist at C:\package.json
And what about all the Module not found: Can't resolve errors?
EDIT:
I have package.json in project folder.
when I run npm run dev it works just fine.
I don't know why he is complaining about C:\package.json
(the project is not under C:\, but C:\Users\User\Desktop\mysite)
When you npm run it will run whatever it is inside the script section of package.json in the directory but for some reason, it is invoked in here. I think there are 2 possibilities.
1/Either your current package.json somehow looks for C:\package.json and the error occurs
2/Your npm cache is including the C:\package.json for some reason try npm cache clean or npm cache clean --force
I think when you read this:
npm ERR! This is probably not a problem with npm.
Probably don`t depend from Npm or nodejs. I supppose some modules are missing in this folder:
./node_modules/node-fetch/lib/index.js
Module not found: Can't resolve 'encoding' in
'C:\Users\User\Desktop\mysite\node_modules\node-fetch\lib'
./node_modules/mongodb/lib/operations/connect.js
Module not found: Can't resolve 'mongodb-client-encryption' in
'C:\Users\User\Desktop\mysite\node_modules\mongodb\lib\operations'
./node_modules/node-pre-gyp/lib/util/compile.js
Module not found: Can't resolve 'node-gyp' in
'C:\Users\User\Desktop\mysite\node_modules\node-pre-gyp\lib\util'
./node_modules/node-pre-gyp/lib/util/compile.js
Module not found: Can't resolve 'npm' in
'C:\Users\User\Desktop\mysite\node_modules\node-pre-gyp\lib\util'
I suggest to write in console:
npm install encoding -g
npm install mongodb-client-encryption -g
npm install node-gyp -g
npm install npm#latest -g
and change folder into "C:\Users\User\Desktop\mysite" then type:
npm install encoding --save
npm install mongodb-client-encryption --save
npm install node-gyp --save
npm install npm#latest --save
And another thing, did you do "npm init"? To initialize your folder then edit it.
I was this error, my solution was:
First, in the packege.json file, in the section scripts, we must modify the property “build”: "next build && next export", and a new property "export": "next export"
Second, we must establish the component and data folders in the root of the project
Third: use the command: npm dev build
Tha give to you and folder with the name "out"
package.json
out folder
I've got an issue when try running server for vue project
this is the issue
ERROR Error: No valid exports main found for
' PROJECT PATH\node_modules\colorette'
Error: No valid exports main found for
'PROJECT PATH\node_modules\colorette'
at resolveExportsTarget (internal/modules/cjs/loader.js:622:9)
at applyExports (internal/modules/cjs/loader.js:499:14)
at resolveExports (internal/modules/cjs/loader.js:548:12)
at Function.Module._findPath (internal/modules/cjs/loader.js:654:22)
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:953:27)
at Function.Module._load (internal/modules/cjs/loader.js:859:27)
at Module.require (internal/modules/cjs/loader.js:1028:19)
at require (internal/modules/cjs/helpers.js:72:18)
at Object. (C:\Users\AlaaMohammed\PhpstormProjects\vue-2\node_modules\autoprefixer\lib\autoprefixer.js:5:17)
at Module._compile (internal/modules/cjs/loader.js:1139:30) npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! vue-2#0.1.0 serve:
vue-cli-service serve npm ERR! Exit status 1 npm ERR! npm ERR!
Failed at the vue-2#0.1.0 serve script. npm ERR! This is probably not
a problem with npm. There is likely additional logging output above.
I want some to response to my problem
try to reinstall the colerette plugin version 1.2.0 manually
npm i colorette#1.2.0
Upgrade node to version 14.5 will resolve this issue.
I did the following and it worked:
1)_ First i checked the versions
npm outdated
npm update
npm install
npx npm-check-updates - u
2)_ Once i was 100% sure the problems didn't come from that source, i typed the following:
npm install autoprefixer#9.8.0
and it solved the problem.
Note: try to "npm start" before you connect the scss to the App, just to see if you can visualize something (like: hello world) in the browser, if everything is fine, create the folder scss with the main.scss inside of it, import it and then try the steps.
My node -v: v16.1.0
What worked for me npm ci
Updating the node version can solve your problem.
My Goal:wanna initialize Vue.js project by running commands vue init webpack myproject
Expected Result: install all the dependencies with no fatal error, AND would be able to start running the project by npm dev run,and run project on http://localhost:8080
ACTUAL Result:
# Installing project dependencies ...
# ========================
npm WARN deprecated extract-text-webpack-plugin#3.0.2: Deprecated. Please use https://gi
thub.com/webpack-contrib/mini-css-extract-plugin
npm WARN deprecated browserslist#2.11.3: Browserslist 2 could fail on reading Browsersli
st >3.0 config used in other tools.
npm WARN deprecated bfj-node4#5.3.1: Switch to the `bfj` package for fixes and new featu
res!
npm WARN deprecated core-js#2.6.11: core-js#<3 is no longer maintained and not recommend
ed for usage due to the number of issues. Please, upgrade your dependencies to the actua
l version of core-js#3.
npm WARN deprecated browserslist#1.7.7: Browserslist 2 could fail on reading Browserslis
t >3.0 config used in other tools.
npm WARN deprecated circular-json#0.3.3: CircularJSON is in maintenance only, flatted is
its successor.
npm ERR! Unexpected end of JSON input while parsing near '...,"dist":{"shasum":"1e'
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Administrator\AppData\Roaming\npm-cache\_logs\2020-02-12T06_01_01_
430Z-debug.log
Running eslint --fix to comply with chosen preset rules...
# ========================
> travel#1.0.0 lint F:\SourceCode\Travel-master\Travel
> eslint --ext .js,.vue src "--fix"
Oops! Something went wrong! :(
ESLint: 6.8.0.
ESLint couldn't find the plugin "eslint-plugin-vue".
(The package "eslint-plugin-vue" was not found when loaded as a Node module from the dir
ectory "F:\SourceCode\Travel-master\Travel".)
It's likely that the plugin isn't installed correctly. Try reinstalling by running the f
ollowing:
npm install eslint-plugin-vue#latest --save-dev
The plugin "eslint-plugin-vue" was referenced from the config file in ".eslintrc.js".
If you still can't figure out the problem, please stop by https://gitter.im/eslint/eslin
t to chat with the team.
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! travel#1.0.0 lint: `eslint --ext .js,.vue src "--fix"`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the travel#1.0.0 lint script.
npm ERR! This is probably not a problem with npm. There is likely additional logging out
put 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! C:\Users\Administrator\AppData\Roaming\npm-cache\_logs\2020-02-12T06_01_04_
492Z-debug.log
# Project initialization finished!
# ========================
To get started:
cd Travel
npm run dev
Documentation can be found at https://vuejs-templates.github.io/webpack
What I've tried
run the commands like above mentioned npm install eslint-plugin-vue#latest --save-dev,then comes another issue like below:
npm ERR! code ETARGET
npm ERR! notarget No matching version found for eslint-plugin-vue#lastest.
npm ERR! notarget In most cases you or one of your dependencies are requesting
npm ERR! notarget a package version that doesn't exist.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Administrator\AppData\Roaming\npm-cache\_logs\2020-02-12T06_09_11_
766Z-debug.log
even I tried the npm install webpack -dev-server -g,then comes another issue like below:
C:\Program Files\nodejs\webpack -> C:\Program Files\nodejs\node_modules\webpack\bin\webp
ack.js
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#1.2.11 (node_modules\webpack\no
de_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#1.2.11:
wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
+ webpack#4.41.6
added 322 packages from 197 contributors in 255.517s
I had the same problem when coding my app (MEVN) and using the command vue init webpack client.
So I did a bit of research notably on npm to see what was wrong and found this: https://www.npmjs.com/package/vue-cli so apparently you can't use this command anymore.
So if you wish to use the vue cli you need to install it trough npm install -g #vue/cli and then run vue create <dir name>
For further information you can look into the documentation: https://www.npmjs.com/package/#vue/cli with the documentation on the vuejs website: https://cli.vuejs.org/
Hope this helps and have fun coding
The maintainers at angular2-universal have not updated their site:
Problem 1)
typings install node express body-parser serve-static express-serve-static-core mime --ambient
typings ERR! deprecated The "ambient" flag is deprecated. Please use "global" instead
Problem 2)
typings install node express body-parser serve-static express-serve-static-core mime --global
typings INFO globaldependencies "express" lists global dependencies on "node" that must be installed manually
typings INFO globaldependencies "body-parser" lists global dependencies on "node" that must be installed manually
typings ERR! message Unable to find "node" ("npm") in the registry.
typings ERR! message However, we found "node" for 2 other sources: "dt" and "env"
typings ERR! message You can install these using the "source" option.
typings ERR! message We could use your help adding these typings to the registry: https://github.com/typings/registry
typings ERR! caused by https://api.typings.org/entries/npm/node/versions/latest responded with 404, expected it to equal 200
typings ERR! cwd /Users/davidmontgomery/Documents/frontend/green
typings ERR! system Darwin 15.6.0
typings ERR! command "/usr/local/bin/node" "/usr/local/bin/typings" "install" "node" "express" "body-parser" "serve-static" "express-serve-static-core" "mime" "--global"
typings ERR! node -v v4.5.0
typings ERR! typings -v 1.3.3
typings ERR! If you need help, you may report this error at:
typings ERR! <https://github.com/typings/typings/issues>
How do I resolve? I am using a mac.
The solution is to install node separately with the --global flag, because it's the only one that needs to be installed globally.
typings install dt~node --global
typings install dt~express dt~body-parser dt~serve-static dt~express-serve-static-core dt~mime
EDIT :
You don't need angular universal for server side rendering anymore, as it is now part of angular core.
As of version 1.0 TypeScript Definition Manager made some updates ([see here][1]) which included deprecating the --ambient flag.
Usages of ambient are now global
That means in typings.json any ambientDependencies should be renamed globalDependencies and any ambientDevDependencies should be
renamed globalDevDependencies.
It also means --ambient is now --global
...
=> For more information, check this out.
[typings github]: https://github.com/typings/typings
[original answer]: Ambient flag is deprecated
Thus, you should use this pattern ↓
typings install dt~PackageName --save --global
ex) typings install dt~body-parser --global --save
Comment below, if you need more help.
With a couple of things changing across typescript and the universal team working overtime to updating universal to the latest releases of angular rc5 and rc6, things have fallen a bit behind on the documentation front.
If you want to get started quickly, checkout out the universal starter kit at https://github.com/angular/universal-starter that should work for you.