nushell.github.io icon indicating copy to clipboard operation
nushell.github.io copied to clipboard

cannot run the website locally

Open amtoine opened this issue 2 years ago • 5 comments

related to

  • #982

when i was working on #982, i tried to npm run dev and have a look at the website but i got the following error :confused:

npm WARN config tmp This setting is no longer used.  npm stores temporary files in a special
npm WARN config location in the cache, and they are managed by
npm WARN config     [`cacache`](http://npm.im/cacache).

> [email protected] dev
> vuepress dev

(node:13792) Warning: To load an ES module, set "type": "module" in the package.json or use the .mjs extension.
(Use `node --trace-warnings ...` to show where the warning was created)
/home/amtoine/documents/repos/github.com/amtoine/nushell.github.io/node_modules/.bin/vuepress:3
import 'vuepress-vite/bin'
^^^^^^

SyntaxError: Cannot use import statement outside a module
    at internalCompileFunction (node:internal/vm:73:18)
    at wrapSafe (node:internal/modules/cjs/loader:1175:20)
    at Module._compile (node:internal/modules/cjs/loader:1219:27)
    at Module._extensions..js (node:internal/modules/cjs/loader:1309:10)
    at Module.load (node:internal/modules/cjs/loader:1113:32)
    at Module._load (node:internal/modules/cjs/loader:960:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:83:12)
    at node:internal/main/run_main_module:23:47

Node.js v20.3.0

i tried running npm install again but still the error...

any idea what is happening?

amtoine avatar Jul 17 '23 17:07 amtoine

Try to use node 16 lts instead, remove all node modules and reinstall. BTW: you can use fnm to manage node verisions and switch between them.

hustcer avatar Jul 18 '23 01:07 hustcer

Try to use node 16 lts instead,

so downgrading 4 major releases?

it used to work not so long ago :thinking:

remove all node modules and reinstall. BTW: you can use fnm to manage node verisions and switch between them.

maybe we should add instructions to the CONTRIBUTING.md file? :yum:

amtoine avatar Jul 18 '23 16:07 amtoine

so downgrading 4 major releases?

It's not 4 major releases but two, only even major numbers are stable releases for node. You can try 18 maybe it will work too

hustcer avatar Jul 18 '23 16:07 hustcer

so downgrading 4 major releases?

It's not 4 major releases but two, only even major numbers are stable releases for node. You can try 18 maybe it will work too

i'm very much not familiar with node, npm and the rest... and my downgrade tool on Arch does not want to downgrade node :cry:

amtoine avatar Jul 18 '23 16:07 amtoine

@amtoine You can use https://github.com/Schniz/fnm to switch between node versions

hustcer avatar Jul 19 '23 01:07 hustcer

This appears to be working on Node 20.14. Can it be closed?

NotTheDr01ds avatar Aug 07 '24 10:08 NotTheDr01ds

Thanks

hustcer avatar Aug 07 '24 10:08 hustcer