package import specifier "#internal/nitro" is not defined in package when running `npm run generate` on windows
See original GitHub issueEnvironment
- Operating System:
Windows_NT
- Node Version:
v16.13.1
- Nuxt Version:
3.0.0-rc.1
- Package Manager:
npm@8.1.2
- Builder:
vite
- User Config:
-
- Runtime Modules:
-
- Build Modules:
-
Reproduction
npx nuxi init nuxt-app
cd nuxt-app
npm install
npm run generate
Describe the bug
Trying out Nuxt 3 for the first time, I mainly care for deploying statically generated sites. I tried out npm run generate
and got this error: Package import specifier “#internal/nitro” is not defined in package.
Additional context
No response
Logs
ERROR [nuxt] [request error] Package import specifier "#internal/nitro" is not defined in package D:\1stuff\dev\2022\prisma-rest-express\nuxt-app\package.json imported from D:\1stuff\dev\2022\prisma-rest-express\nuxt-app\.nuxt\dist\server\server.mjs
at new NodeError (node:internal/errors:371:5)
at throwImportNotDefined (node:internal/modules/esm/resolve:429:9)
at packageImportsResolve (node:internal/modules/esm/resolve:778:3)
at moduleResolve (node:internal/modules/esm/resolve:924:21)
at defaultResolve (node:internal/modules/esm/resolve:1044:11)
at ESMLoader.resolve (node:internal/modules/esm/loader:422:30)
at ESMLoader.getModuleJob (node:internal/modules/esm/loader:222:40)
at ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:76:40)
at link (node:internal/modules/esm/module_job:75:36)
Issue Analytics
- State:
- Created a year ago
- Reactions:29
- Comments:15 (1 by maintainers)
Top Results From Across the Web
Nuxt 3 package import specifier "#internal/nitro" is not defined
Im not sure, but I guess your npm is trying to find the module #internal/nitro on your package.json which is dist\server\server. · Got...
Read more >npm-init | npm Docs
initializer in this case is an npm package named create-<initializer> , which will be installed by npm-exec , and then have its main...
Read more >npm-exec
This command allows you to run an arbitrary command from an npm package (either one installed locally, or fetched remotely), in a similar...
Read more >npx - npm Docs
The --package option may be specified multiple times, to execute the supplied command in an environment where all specified packages are available.
Read more >http-server - npm
Start using http-server in your project by running `npm i http-server`. ... As a dependency in your npm package: npm install http-server ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
With version 3.0.0-rc.3 still gives the same error.
I understand that it is normal because they have not said that they have corrected it in this update xD, but this way I avoid you to test it this RC.
Same here, this is my use-case and its failing on Windows.
In linux the command works correctly so, in the worst case, I can launch it from there.
I think is some type of a problem with the alias in windows:
node_modules@nuxt\vite-builder\dist\index.mjs
node_modules\nuxt\dist\index.mjs
I’ve only tracked up to that point, I don’t even know if it could be useful xD