babel / babel/gulp-babel

Cannot find package '@babel/plugin-transform-runtime'

Open
#226 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
1.3k
Forks
113
PR merge metrics
No merged PRs in 30d

Description

我基于gulp写了一个脚手架,用到了gulp-babel编译js
我写好这个脚手架后发布到npm,然后在本地新建一个文件夹局部安装这个脚手架一切正常
但是当我把这个脚手架全局安装后在项目文件夹使用会报错

[15:34:15] Error in plugin "gulp-babel"
Message:
Cannot find package '@babel/plugin-transform-runtime' imported from C:\Users\57481\Desktop\github\test-gulp-admin-global\babel-virtual-resolve-base.js

唯一的区别就是一个是局部安装一个是全局安装

`gulp.task("js", function () {
return (
gulp
.src(resolvePath("src/**/*.js"))
.pipe(
babel({
presets: ["@babel/env"],
plugins: ["@babel/transform-runtime"],
})
)
.pipe(browserify())
.pipe(gulp.dest(dist))
.pipe(connect.reload())
);
});`

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the reported gulp.task snippet and the Cannot find package '@babel/plugin-transform-runtime' error. Compare dependency resolution for the local and global installations, then verify the result by running the scaffold globally and locally; done means both modes can compile the JavaScript without this error.

Written by the indexing model from the issue text.

Assessment

Tech stack
babel, javascript
Domain
build-system
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.