4
repl.it is ignoring package.json and trying to install invalid packages
complete
ubershmekel
This is my first time trying repl.it, seems busted. The error I'm getting when I hit the "run" button is:
----------
Repl.it: Updating package configuration
--> npm install @sapper/server @sapper/app
npm ERR! code E404
npm ERR! 404 Not Found - GET https://registry.npmjs.org/@sapper%2fserver - Not found
npm ERR! 404
npm ERR! 404 '@sapper/server@latest' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/runner/.npm/_logs/2021-02-14T00_18_02_719Z-debug.log
exit status 1
-------------
Both
@sapper/server
and @sapper/app
are imports in the code, but they are installed by sapper
in the package.json
file. So I don't know why replit is trying to install these or how to disable it.Activity
Newest
Oldest
Obaida Albaroudi
complete
Looks like this is good to go! If you run into any issues please do raise a ticket or email us at contact@repl.it with urgent in the subject line.
r
replit
Hi, as mentioned on Twitter, here is your repl running correctly: https://repl.it/@amasad/podium2
Replit's packager (upm) has a neat feature which detects packages in the code and installs them for you. It's great when starting a new project. Try a new repl and require('express') and it will do the right thing.
It looks like Sapper, however, has client-side packages that are not real (i.e. not on npm) and that trips of our packager. However, it's easy to ignore a certain path. I just added the following to the .replit file
ignoredPaths=["src"]
And it works. In the future, we'll have a better UX around this and possibly be more intelligent about failed packages.
ubershmekel
To clarify the solution from amasad, you add the following to the .replit file:
[packager]
ignoredPaths=["src"]
The "edit post" button isn't working, so here's the package.json for the curious:
{
"name": "podium",
"description": "Argue over the internet",
"version": "0.0.1",
"scripts": {
"dev": "sapper dev",
"build": "sapper build --legacy",
"export": "sapper export --legacy",
"server-production": "node __sapper__/build",
"start": "run-s build server-production",
"validate": "svelte-check --ignore src/node_modules/@sapper"
},
"dependencies": {
"compression": "^1.7.1",
"npm-run-all": "^4.1.5",
"polka": "next",
"sirv": "^1.0.0",
"socket.io": "^3.1.0",
"socket.io-client": "^3.1.0"
},
"devDependencies": {
"@babel/core": "^7.0.0",
"@babel/plugin-syntax-dynamic-import": "^7.0.0",
"@babel/plugin-transform-runtime": "^7.0.0",
"@babel/preset-env": "^7.0.0",
"@babel/runtime": "^7.0.0",
"@rollup/plugin-babel": "^5.0.0",
"@rollup/plugin-commonjs": "^14.0.0",
"@rollup/plugin-node-resolve": "^8.0.0",
"@rollup/plugin-replace": "^2.2.0",
"@rollup/plugin-typescript": "^6.0.0",
"@rollup/plugin-url": "^5.0.0",
"@tsconfig/svelte": "^1.0.10",
"@types/compression": "^1.7.0",
"@types/node": "^14.11.1",
"@types/polka": "^0.5.1",
"@types/socket.io": "^2.1.12",
"@types/socket.io-client": "^1.4.35",
"rollup": "^2.3.4",
"rollup-plugin-svelte": "^7.0.0",
"rollup-plugin-terser": "^7.0.0",
"sapper": "^0.28.0",
"svelte": "^3.17.3",
"svelte-check": "^1.0.46",
"svelte-preprocess": "^4.3.0",
"tslib": "^2.0.1",
"typescript": "^4.0.3"
}
}