Folder saya adalah src dan saya telah menginstal babel melalui CLI, namun saya masih mendapatkan pesan kesalahan, "babel: src tidak ada"
Berikut rekaman singkat kode saya: https://drive.google.com/file/d/1YgEnJE87c0mEnsefY1xU94cvUedBtGhK/view
Lihat di atas apa yang saya coba.
{
"name": "notes-app",
"version": "1.0.0",
"description": "",
"main": "app.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"build": "babel src -d lib"
},
"author": "Jono Suave",
"license": "ISC",
"devDependencies": {
"@babel/cli": "^7.7.0",
"@babel/core": "^7.7.2"
}
}
aplikasi.js
import getNotes from "notes.js"
getNotes()
catatan.js
let getNotes = function() {
console.log(`Put the time in baby!`)
}
module.exports = getNotes
Saya mengharapkan babel untuk menjalankan dan mengkompilasi kode impor ES6 saya di app.js, tetapi malah menerima kesalahan berikut di terminal:
babel:
src does not exist
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! [email protected] build: `babel src -d lib`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the [email protected] 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! /Users/jonosuave/.npm/_logs/2019-11-07T01_56_26_260Z-debug.log
package.json
di dalamsrc
? Biasanya mereka adalah saudara kandung. - person loganfsmyth   schedule 07.11.2019