Build error: Not supported
Closed this issue · 9 comments
Hi, I tried to build the website on Ubuntu 20.04.3 LTS, with Node 10.19.0 and npm 6.14.4.
Upon running npm run build
, the following error occurs:
> @ build /home/mattia/4thEra/animeflix
> next build
error - Failed to load next.config.js, see more info here https://nextjs.org/docs/messages/next-config-error
> Build error occurred
Error: Not supported
at Object.loadConfig [as default] (/home/mattia/4thEra/animeflix/node_modules/next/dist/server/config.js:399:74)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @ build: `next build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @ 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! /home/mattia/.npm/_logs/2021-12-01T13_03_09_766Z-debug.log
These are the warnings upon npm install
:
npm WARN @babel/plugin-syntax-jsx@7.14.5 requires a peer of @babel/core@^7.0.0-0 but none is installed. You must install peer dependencies yourself.
npm WARN @vime/react@5.3.0 requires a peer of @vime/core@5.3.0 but none is installed. You must install peer dependencies yourself.
npm WARN graphql-request@3.6.1 requires a peer of graphql@14.x || 15.x but none is installed. You must install peer dependencies yourself.
npm WARN tsutils@3.21.0 requires a peer of typescript@>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @next/swc-android-arm64@12.0.4 (node_modules/@next/swc-android-arm64):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for @next/swc-android-arm64@12.0.4: wanted {"os":"android","arch":"arm64"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @next/swc-darwin-x64@12.0.4 (node_modules/@next/swc-darwin-x64):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for @next/swc-darwin-x64@12.0.4: wanted {"os":"darwin","arch":"x64"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @next/swc-linux-arm-gnueabihf@12.0.4 (node_modules/@next/swc-linux-arm-gnueabihf):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for @next/swc-linux-arm-gnueabihf@12.0.4: wanted {"os":"linux","arch":"arm"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @next/swc-linux-arm64-gnu@12.0.4 (node_modules/@next/swc-linux-arm64-gnu):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for @next/swc-linux-arm64-gnu@12.0.4: wanted {"os":"linux","arch":"arm64"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @next/swc-win32-ia32-msvc@12.0.4 (node_modules/@next/swc-win32-ia32-msvc):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for @next/swc-win32-ia32-msvc@12.0.4: wanted {"os":"win32","arch":"ia32"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @next/swc-linux-arm64-musl@12.0.4 (node_modules/@next/swc-linux-arm64-musl):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for @next/swc-linux-arm64-musl@12.0.4: wanted {"os":"linux","arch":"arm64"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @next/swc-win32-x64-msvc@12.0.4 (node_modules/@next/swc-win32-x64-msvc):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for @next/swc-win32-x64-msvc@12.0.4: wanted {"os":"win32","arch":"x64"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @next/swc-darwin-arm64@12.0.4 (node_modules/@next/swc-darwin-arm64):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for @next/swc-darwin-arm64@12.0.4: wanted {"os":"darwin","arch":"arm64"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @next/swc-win32-arm64-msvc@12.0.4 (node_modules/@next/swc-win32-arm64-msvc):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for @next/swc-win32-arm64-msvc@12.0.4: wanted {"os":"win32","arch":"arm64"} (current: {"os":"linux","arch":"x64"})
audited 534 packages in 5.344s
95 packages are looking for funding
run `npm fund` for details
found 0 vulnerabilities
~~~
What the heck is happening? I found no support online 😵💫
I think you should update your node and npm version. I am on Windows and use
node v16.9.1
and npm v7.21.1
.
also try to download dependencies again using npm ci
I now updated NodeJS following these instructions ^_^ I am now with NodeJS 16.13.1 and npm 8.1.2.
There are still errors, though:
$ npm run build
> build
> next build
Attention: Next.js now collects completely anonymous telemetry regarding usage.
This information is used to shape Next.js' roadmap and prioritize features.
You can learn more, including how to opt-out if you'd not like to participate in this anonymous program, by visiting the following URL:
https://nextjs.org/telemetry
info - Checking validity of types
warn - You have enabled the JIT engine which is currently in preview.
warn - Preview features are not covered by semver, may introduce breaking changes, and can change at any time.
info - Creating an optimized production build
Failed to compile.
./node_modules/@vime/react/dist/esm/components/Audio.jsx
Module not found: Can't resolve '@vime/core' in '/home/mattia/4thEra/animeflix/node_modules/@vime/react/dist/esm/components'
Import trace for requested module:
./node_modules/@vime/react/dist/esm/components/index.js
./node_modules/@vime/react/dist/esm/index.js
./components/VideoPlayer.js
./pages/watch/[id].js
./node_modules/@vime/react/dist/esm/components/CaptionControl.jsx
Module not found: Can't resolve '@vime/core' in '/home/mattia/4thEra/animeflix/node_modules/@vime/react/dist/esm/components'
Import trace for requested module:
./node_modules/@vime/react/dist/esm/components/index.js
./node_modules/@vime/react/dist/esm/index.js
./components/VideoPlayer.js
./pages/watch/[id].js
./node_modules/@vime/react/dist/esm/components/Captions.jsx
Module not found: Can't resolve '@vime/core' in '/home/mattia/4thEra/animeflix/node_modules/@vime/react/dist/esm/components'
Import trace for requested module:
./node_modules/@vime/react/dist/esm/components/index.js
./node_modules/@vime/react/dist/esm/index.js
./components/VideoPlayer.js
./pages/watch/[id].js
./node_modules/@vime/react/dist/esm/components/ClickToPlay.jsx
Module not found: Can't resolve '@vime/core' in '/home/mattia/4thEra/animeflix/node_modules/@vime/react/dist/esm/components'
Import trace for requested module:
./node_modules/@vime/react/dist/esm/components/index.js
./node_modules/@vime/react/dist/esm/index.js
./components/VideoPlayer.js
./pages/watch/[id].js
./node_modules/@vime/react/dist/esm/components/Control.jsx
Module not found: Can't resolve '@vime/core' in '/home/mattia/4thEra/animeflix/node_modules/@vime/react/dist/esm/components'
Import trace for requested module:
./node_modules/@vime/react/dist/esm/components/index.js
./node_modules/@vime/react/dist/esm/index.js
./components/VideoPlayer.js
./pages/watch/[id].js
> Build failed because of webpack errors
I have no idea about the error, but if someone else also faced the same issue they can help.
re-download node_modules and try if it works. I guess time to containerize this app.
@sakuragasaki46 It seems like some modules from your node_modules
folder are either missing or is not being able to find even if it exists. Please delete your node_modules
and run npm i
once again.
I’ve deleted all the node_modules
and rerun npm i
once again.
Still getting the same error.
$ rm -r node_modules/
$ npm i
added 524 packages, and audited 525 packages in 5s
95 packages are looking for funding
run `npm fund` for details
found 0 vulnerabilities
mattia@mattia-ThinkPad-E595:~/4thEra/animeflix$ npm run build
> build
> next build
info - Checking validity of types
info - Creating an optimized production build
Failed to compile.
./node_modules/@vime/react/dist/esm/components/Audio.jsx
Module not found: Can't resolve '@vime/core' in '/home/mattia/4thEra/animeflix/node_modules/@vime/react/dist/esm/components'
Import trace for requested module:
./node_modules/@vime/react/dist/esm/components/index.js
./node_modules/@vime/react/dist/esm/index.js
./components/VideoPlayer.js
./pages/watch/[id].js
./node_modules/@vime/react/dist/esm/components/CaptionControl.jsx
Module not found: Can't resolve '@vime/core' in '/home/mattia/4thEra/animeflix/node_modules/@vime/react/dist/esm/components'
Import trace for requested module:
./node_modules/@vime/react/dist/esm/components/index.js
./node_modules/@vime/react/dist/esm/index.js
./components/VideoPlayer.js
./pages/watch/[id].js
./node_modules/@vime/react/dist/esm/components/Captions.jsx
Module not found: Can't resolve '@vime/core' in '/home/mattia/4thEra/animeflix/node_modules/@vime/react/dist/esm/components'
Import trace for requested module:
./node_modules/@vime/react/dist/esm/components/index.js
./node_modules/@vime/react/dist/esm/index.js
./components/VideoPlayer.js
./pages/watch/[id].js
./node_modules/@vime/react/dist/esm/components/ClickToPlay.jsx
Module not found: Can't resolve '@vime/core' in '/home/mattia/4thEra/animeflix/node_modules/@vime/react/dist/esm/components'
Import trace for requested module:
./node_modules/@vime/react/dist/esm/components/index.js
./node_modules/@vime/react/dist/esm/index.js
./components/VideoPlayer.js
./pages/watch/[id].js
./node_modules/@vime/react/dist/esm/components/Control.jsx
Module not found: Can't resolve '@vime/core' in '/home/mattia/4thEra/animeflix/node_modules/@vime/react/dist/esm/components'
Import trace for requested module:
./node_modules/@vime/react/dist/esm/components/index.js
./node_modules/@vime/react/dist/esm/index.js
./components/VideoPlayer.js
./pages/watch/[id].js
> Build failed because of webpack errors
mattia@mattia-ThinkPad-E595:~/4thEra/animeflix$
What am I supposed to do? Clear npm cache? Or open an issue on the @vime/core
package mantainers?
What I have attempted so far:
- Clearing npm cache. In fact, I have run only
npm cache verify
notnpm cache clean --force
, as suggested by npm. After install, still getting the error. - Tampering with
package.json
. I added the line:"@vime/core": "^5.3.0",
right under"@vime/react": "^5.3.0",
intopackage.json
.
The last attempt was successful. After npm i
, code did compile.
It was just a missing line from package.json.
Another update: There was another package missing from package.json: graphql
. I added it (on my own computer) with npm install --save graphql
. Without it, homepage was simply a "500 Internal Server Error" screen.
thanks, so it's fixed now? I am closing this issue now