-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve error message when typescript is missing #977
Comments
Actually Parcel has a feature that automatically installs dependencies for you. So it actually should install TypeScript for you 100% automatically. See: #306(merged) and #805(work in progress) If you look at the error message, notice how at the bottom the error comes from the So looks like this is a problem with error handling in autoinstall. I tried to reproduce this on my Mac (MacOS High Siera), and I wasn’t able to get the same error. Can you please try to download and run Also, can you please fill out the system information table from the issue template. Here’s my info:
|
I see. I cloned the example and it works there, even when I remove typescript in the package.json. |
It would be nice to have an obvious error message as the install can still fail. |
I have this files structure:
This is a <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Examples Grid</title>
<script src="../dist/va.js"/>
</head>
<body>
...
</body>
</html> This is a require('./../src/va.sass');
module.exports = function () {
return 2;
}; What I get after run $ parcel examples/grid.html
Server running at http://localhost:1234
🚨 /home/toby3d/git/va/src/va.sass:undefined:undefined: spawn ENOTDIR
at ChildProcess.spawn (internal/child_process.js:330:11)
at Object.exports.spawn (child_process.js:500:9)
at spawn (/home/toby3d/.npm-global/lib/node_modules/parcel-bundler/node_modules/cross-spawn/index.js:12:24)
at Promise (/home/toby3d/.npm-global/lib/node_modules/parcel-bundler/src/utils/installPackage.js:19:17)
at new Promise (<anonymous>)
at install (/home/toby3d/.npm-global/lib/node_modules/parcel-bundler/src/utils/installPackage.js:10:10)
at <anonymous> |
When referencing a .ts file and running parcel like this:
parcel index.html
results in this confusing error:
It can be solved by simply installing typescript locally:
npm i typescript -D
The error message should be something like "Typescript should be installed l locally" or "Typescript binary is missing".
The text was updated successfully, but these errors were encountered: